Loading drivers/extcon/extcon.c +11 −0 Original line number Diff line number Diff line Loading @@ -881,6 +881,17 @@ int extcon_set_property_capability(struct extcon_dev *edev, unsigned int id, } EXPORT_SYMBOL_GPL(extcon_set_property_capability); int extcon_set_mutually_exclusive(struct extcon_dev *edev, const u32 *exclusive) { if (!edev) return -EINVAL; edev->mutually_exclusive = exclusive; return 0; } EXPORT_SYMBOL(extcon_set_mutually_exclusive); /** * extcon_get_extcon_dev() - Get the extcon device instance from the name. * @extcon_name: the extcon name provided with extcon_dev_register() Loading drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -934,3 +934,21 @@ ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr, chan->channel, buf, len); } EXPORT_SYMBOL_GPL(iio_write_channel_ext_info); int iio_write_channel_processed(struct iio_channel *chan, int val) { int ret; mutex_lock(&chan->indio_dev->info_exist_lock); if (chan->indio_dev->info == NULL) { ret = -ENODEV; goto err_unlock; } ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_PROCESSED); err_unlock: mutex_unlock(&chan->indio_dev->info_exist_lock); return ret; } EXPORT_SYMBOL(iio_write_channel_processed); include/linux/extcon.h +8 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,14 @@ extern int extcon_get_property(struct extcon_dev *edev, unsigned int id, extern int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); /* * Following APIs set array of mutually exclusive. * The 'exclusive' argument indicates the array of mutually exclusive set * of cables that cannot be attached simultaneously. */ extern int extcon_set_mutually_exclusive(struct extcon_dev *edev, const u32 *exclusive); /* * Following APIs register the notifier block in order to detect * the change of both state and property value for each external connector. Loading include/linux/iio/consumer.h +9 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,15 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); */ int iio_read_avail_channel_raw(struct iio_channel *chan, const int **vals, int *length); /** * iio_write_channel_processed() - write to a given channel * @chan: The channel being queried. * @val: Value being written. * * Note processed writes to iio channels are converted to raw * values before being written. */ int iio_write_channel_processed(struct iio_channel *chan, int val); /** * iio_get_channel_type() - get the type of a channel Loading Loading
drivers/extcon/extcon.c +11 −0 Original line number Diff line number Diff line Loading @@ -881,6 +881,17 @@ int extcon_set_property_capability(struct extcon_dev *edev, unsigned int id, } EXPORT_SYMBOL_GPL(extcon_set_property_capability); int extcon_set_mutually_exclusive(struct extcon_dev *edev, const u32 *exclusive) { if (!edev) return -EINVAL; edev->mutually_exclusive = exclusive; return 0; } EXPORT_SYMBOL(extcon_set_mutually_exclusive); /** * extcon_get_extcon_dev() - Get the extcon device instance from the name. * @extcon_name: the extcon name provided with extcon_dev_register() Loading
drivers/iio/inkern.c +18 −0 Original line number Diff line number Diff line Loading @@ -934,3 +934,21 @@ ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr, chan->channel, buf, len); } EXPORT_SYMBOL_GPL(iio_write_channel_ext_info); int iio_write_channel_processed(struct iio_channel *chan, int val) { int ret; mutex_lock(&chan->indio_dev->info_exist_lock); if (chan->indio_dev->info == NULL) { ret = -ENODEV; goto err_unlock; } ret = iio_channel_write(chan, val, 0, IIO_CHAN_INFO_PROCESSED); err_unlock: mutex_unlock(&chan->indio_dev->info_exist_lock); return ret; } EXPORT_SYMBOL(iio_write_channel_processed);
include/linux/extcon.h +8 −0 Original line number Diff line number Diff line Loading @@ -200,6 +200,14 @@ extern int extcon_get_property(struct extcon_dev *edev, unsigned int id, extern int extcon_get_property_capability(struct extcon_dev *edev, unsigned int id, unsigned int prop); /* * Following APIs set array of mutually exclusive. * The 'exclusive' argument indicates the array of mutually exclusive set * of cables that cannot be attached simultaneously. */ extern int extcon_set_mutually_exclusive(struct extcon_dev *edev, const u32 *exclusive); /* * Following APIs register the notifier block in order to detect * the change of both state and property value for each external connector. Loading
include/linux/iio/consumer.h +9 −0 Original line number Diff line number Diff line Loading @@ -289,6 +289,15 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val); */ int iio_read_avail_channel_raw(struct iio_channel *chan, const int **vals, int *length); /** * iio_write_channel_processed() - write to a given channel * @chan: The channel being queried. * @val: Value being written. * * Note processed writes to iio channels are converted to raw * values before being written. */ int iio_write_channel_processed(struct iio_channel *chan, int val); /** * iio_get_channel_type() - get the type of a channel Loading