Re: [PATCH 1/2] iio: industrialio-core: Add IIO_OUT type

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/10/11 12:49, michael.hennerich@xxxxxxxxxx wrote:
> From: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
> 
> Add IIO_OUT type for DAC like devices
> In case of IIO_OUT make sure the channel device attribute is writable
> 
> Ideally we add a flag to iio_chan_spec that tells the core that
> the channel device attribute is writable...
That probably makes sense if / when we redo the naming again.
> 
> Signed-off-by: Michael Hennerich <michael.hennerich@xxxxxxxxxx>
Acked-by: Jonathan Cameron <jic23@xxxxxxxxx>
> ---
>  drivers/staging/iio/iio.h               |    1 +
>  drivers/staging/iio/industrialio-core.c |    4 +++-
>  2 files changed, 4 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/staging/iio/iio.h b/drivers/staging/iio/iio.h
> index 9ca89c7..7a6ce4d 100644
> --- a/drivers/staging/iio/iio.h
> +++ b/drivers/staging/iio/iio.h
> @@ -30,6 +30,7 @@
>  enum iio_chan_type {
>  	/* real channel types */
>  	IIO_IN,
> +	IIO_OUT,
>  	IIO_CURRENT,
>  	IIO_POWER,
>  	IIO_ACCEL,
> diff --git a/drivers/staging/iio/industrialio-core.c b/drivers/staging/iio/industrialio-core.c
> index 744153e..8fa2be6 100644
> --- a/drivers/staging/iio/industrialio-core.c
> +++ b/drivers/staging/iio/industrialio-core.c
> @@ -47,6 +47,7 @@ static const char * const iio_chan_type_name_spec_shared[] = {
>  	[IIO_TIMESTAMP] = "timestamp",
>  	[IIO_ACCEL] = "accel",
>  	[IIO_IN] = "in",
> +	[IIO_OUT] = "out",
>  	[IIO_CURRENT] = "current",
>  	[IIO_POWER] = "power",
>  	[IIO_IN_DIFF] = "in-in",
> @@ -675,7 +676,8 @@ static int iio_device_add_channel_sysfs(struct iio_dev *dev_info,
>  	else
>  		ret = __iio_add_chan_devattr("raw", NULL, chan,
>  					     &iio_read_channel_info,
> -					     NULL,
> +					     (chan->type == IIO_OUT ?
> +					     &iio_write_channel_info : NULL),
>  					     0,
>  					     0,
>  					     &dev_info->dev,

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux