]> Git Repo - linux.git/commitdiff
Merge tag 'tag-chrome-platform-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel...
authorLinus Torvalds <[email protected]>
Thu, 9 Apr 2020 04:25:49 +0000 (21:25 -0700)
committerLinus Torvalds <[email protected]>
Thu, 9 Apr 2020 04:25:49 +0000 (21:25 -0700)
Pull chrome platform updates from Benson Leung:

  cros-usbpd-notify and cros_ec_typec:
   - Add a new notification driver that handles and dispatches USB PD
     related events to other drivers.
   - Add a Type C connector class driver for cros_ec

  CrOS EC:
   - Introduce a new cros_ec_cmd_xfer_status helper

  Sensors/iio:
   - A series from Gwendal that adds Cros EC sensor hub FIFO support

  Wilco EC:
   - Fix a build warning.
   - Platform data shouldn't include kernel.h

  Misc:
   - i2c api conversion complete, with i2c_new_client_device instead of
     i2c_new_device in chromeos_laptop.
   - Replace zero-length array with flexible-array member in
     cros_ec_chardev and wilco_ec
   - Update new structure for SPI transfer delays in cros_ec_spi

* tag 'tag-chrome-platform-for-v5.7' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: (34 commits)
  platform/chrome: cros_ec_spi: Wait for USECS, not NSECS
  iio: cros_ec: Use Hertz as unit for sampling frequency
  iio: cros_ec: Report hwfifo_watermark_max
  iio: cros_ec: Expose hwfifo_timeout
  iio: cros_ec: Remove pm function
  iio: cros_ec: Register to cros_ec_sensorhub when EC supports FIFO
  iio: expose iio_device_set_clock
  iio: cros_ec: Move function description to .c file
  platform/chrome: cros_ec_sensorhub: Add median filter
  platform/chrome: cros_ec_sensorhub: Add code to spread timestmap
  platform/chrome: cros_ec_sensorhub: Add FIFO support
  platform/chrome: cros_ec_sensorhub: Add the number of sensors in sensorhub
  platform/chrome: chromeos_laptop: make I2C API conversion complete
  platform/chrome: wilco_ec: event: Replace zero-length array with flexible-array member
  platform/chrome: cros_ec_chardev: Replace zero-length array with flexible-array member
  platform/chrome: cros_ec_typec: Update port info from EC
  platform/chrome: Add Type C connector class driver
  platform/chrome: cros_usbpd_notify: Pull PD_HOST_EVENT status
  platform/chrome: cros_usbpd_notify: Amend ACPI driver to plat
  platform/chrome: cros_usbpd_notify: Add driver data struct
  ...

1  2 
drivers/iio/industrialio-core.c
drivers/power/supply/Kconfig
include/linux/iio/iio.h

index eac63c1bb8da0d970e0a0b78bb01e7fef3158756,26e963483bab0141d1cd0e834923bc712d209c80..2352c426bfb5baf99da6ed5c8b5de8081d45e074
@@@ -189,7 -189,12 +189,12 @@@ ssize_t iio_read_const_attr(struct devi
  }
  EXPORT_SYMBOL(iio_read_const_attr);
  
- static int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id)
+ /**
+  * iio_device_set_clock() - Set current timestamping clock for the device
+  * @indio_dev: IIO device structure containing the device
+  * @clock_id: timestamping clock posix identifier to set.
+  */
+ int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id)
  {
        int ret;
        const struct iio_event_interface *ev_int = indio_dev->event_interface;
  
        return 0;
  }
+ EXPORT_SYMBOL(iio_device_set_clock);
  
  /**
   * iio_get_time_ns() - utility function to get a time stamp for events etc
@@@ -301,14 -307,11 +307,14 @@@ static ssize_t iio_debugfs_read_reg(str
                              size_t count, loff_t *ppos)
  {
        struct iio_dev *indio_dev = file->private_data;
 -      char buf[20];
        unsigned val = 0;
 -      ssize_t len;
        int ret;
  
 +      if (*ppos > 0)
 +              return simple_read_from_buffer(userbuf, count, ppos,
 +                                             indio_dev->read_buf,
 +                                             indio_dev->read_buf_len);
 +
        ret = indio_dev->info->debugfs_reg_access(indio_dev,
                                                  indio_dev->cached_reg_addr,
                                                  0, &val);
                return ret;
        }
  
 -      len = snprintf(buf, sizeof(buf), "0x%X\n", val);
 +      indio_dev->read_buf_len = snprintf(indio_dev->read_buf,
 +                                         sizeof(indio_dev->read_buf),
 +                                         "0x%X\n", val);
  
 -      return simple_read_from_buffer(userbuf, count, ppos, buf, len);
 +      return simple_read_from_buffer(userbuf, count, ppos,
 +                                     indio_dev->read_buf,
 +                                     indio_dev->read_buf_len);
  }
  
  static ssize_t iio_debugfs_write_reg(struct file *file,
@@@ -776,18 -775,17 +782,18 @@@ static ssize_t iio_read_channel_info_av
  }
  
  /**
 - * iio_str_to_fixpoint() - Parse a fixed-point number from a string
 + * __iio_str_to_fixpoint() - Parse a fixed-point number from a string
   * @str: The string to parse
   * @fract_mult: Multiplier for the first decimal place, should be a power of 10
   * @integer: The integer part of the number
   * @fract: The fractional part of the number
 + * @scale_db: True if this should parse as dB
   *
   * Returns 0 on success, or a negative error code if the string could not be
   * parsed.
   */
 -int iio_str_to_fixpoint(const char *str, int fract_mult,
 -      int *integer, int *fract)
 +static int __iio_str_to_fixpoint(const char *str, int fract_mult,
 +                               int *integer, int *fract, bool scale_db)
  {
        int i = 0, f = 0;
        bool integer_part = true, negative = false;
                                break;
                        else
                                return -EINVAL;
 +              } else if (!strncmp(str, " dB", sizeof(" dB") - 1) && scale_db) {
 +                      /* Ignore the dB suffix */
 +                      str += sizeof(" dB") - 1;
 +                      continue;
 +              } else if (!strncmp(str, "dB", sizeof("dB") - 1) && scale_db) {
 +                      /* Ignore the dB suffix */
 +                      str += sizeof("dB") - 1;
 +                      continue;
                } else if (*str == '.' && integer_part) {
                        integer_part = false;
                } else {
  
        return 0;
  }
 +
 +/**
 + * iio_str_to_fixpoint() - Parse a fixed-point number from a string
 + * @str: The string to parse
 + * @fract_mult: Multiplier for the first decimal place, should be a power of 10
 + * @integer: The integer part of the number
 + * @fract: The fractional part of the number
 + *
 + * Returns 0 on success, or a negative error code if the string could not be
 + * parsed.
 + */
 +int iio_str_to_fixpoint(const char *str, int fract_mult,
 +                      int *integer, int *fract)
 +{
 +      return __iio_str_to_fixpoint(str, fract_mult, integer, fract, false);
 +}
  EXPORT_SYMBOL_GPL(iio_str_to_fixpoint);
  
  static ssize_t iio_write_channel_info(struct device *dev,
        int ret, fract_mult = 100000;
        int integer, fract = 0;
        bool is_char = false;
 +      bool scale_db = false;
  
        /* Assumes decimal - precision based on number of digits */
        if (!indio_dev->info->write_raw)
                case IIO_VAL_INT:
                        fract_mult = 0;
                        break;
 +              case IIO_VAL_INT_PLUS_MICRO_DB:
 +                      scale_db = true;
 +                      /* fall through */
                case IIO_VAL_INT_PLUS_MICRO:
                        fract_mult = 100000;
                        break;
                if (ret)
                        return ret;
        }
 +      ret = __iio_str_to_fixpoint(buf, fract_mult, &integer, &fract,
 +                                  scale_db);
 +      if (ret)
 +              return ret;
  
        ret = indio_dev->info->write_raw(indio_dev, this_attr->c,
                                         integer, fract, this_attr->address);
index 195bc0462d3ef924332dc72c12e534043a667b25,a6e191b4ff481b721f89cf7bc6111e68e8d90b29..f3424fdce341a9d594984b913dbdf1bb9e80d35f
@@@ -480,7 -480,7 +480,7 @@@ config CHARGER_GPI
          called gpio-charger.
  
  config CHARGER_MANAGER
 -      bool "Battery charger manager for multiple chargers"
 +      tristate "Battery charger manager for multiple chargers"
        depends on REGULATOR
        select EXTCON
        help
@@@ -659,7 -659,7 +659,7 @@@ config CHARGER_RT945
  
  config CHARGER_CROS_USBPD
        tristate "ChromeOS EC based USBPD charger"
-       depends on CROS_EC
+       depends on CROS_USBPD_NOTIFY
        default n
        help
          Say Y here to enable ChromeOS EC based USBPD charger
diff --combined include/linux/iio/iio.h
index eed58ed2f36880b755c4ede5a7b799318b5b67e5,b18f34a8901f31bbdc7c21e2791e3807a7b0661f..17f56a070b205a1ebab8cea9ef1ae2c8960238bc
@@@ -568,8 -568,6 +568,8 @@@ struct iio_dev 
  #if defined(CONFIG_DEBUG_FS)
        struct dentry                   *debugfs_dentry;
        unsigned                        cached_reg_addr;
 +      char                            read_buf[20];
 +      unsigned int                    read_buf_len;
  #endif
  };
  
@@@ -629,6 -627,8 +629,8 @@@ static inline clockid_t iio_device_get_
        return indio_dev->clock_id;
  }
  
+ int iio_device_set_clock(struct iio_dev *indio_dev, clockid_t clock_id);
  /**
   * dev_to_iio_dev() - Get IIO device struct from a device struct
   * @dev:              The device embedded in the IIO device
This page took 0.100141 seconds and 4 git commands to generate.