Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8c0e61db authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "extcon: add API to update array of mutually exclusive set"

parents d7922727 b6f2b55c
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -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()
+18 −0
Original line number Diff line number Diff line
@@ -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);
+8 −0
Original line number Diff line number Diff line
@@ -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.
+9 −0
Original line number Diff line number Diff line
@@ -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