All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries
@ 2012-04-15 11:41 Jonathan Cameron
  2012-04-15 13:42 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2012-04-15 11:41 UTC (permalink / raw)
  To: linux-iio; +Cc: device-drivers-devel, lars, ldewangan, Jonathan Cameron

Precursor to making value read / write attribute optional.
This one stands along as it merged just before the series
doing all the other drivers.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>
---
This driver crossed with review of these patches.  To test
just apply it after the series 
[PATCH 00/13 V2] IIO: Make the value attribute optional for channels

Fairly trivial case, but obviously I can't push out the removal
of the old code until this is in place.  In the meantime I'll push
the rest of the conversion patches to Greg.


 drivers/staging/iio/light/isl29028.c |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
index e705e45..5ef2d0d 100644
--- a/drivers/staging/iio/light/isl29028.c
+++ b/drivers/staging/iio/light/isl29028.c
@@ -330,7 +330,8 @@ static int isl29028_read_raw(struct iio_dev *indio_dev,
 
 	mutex_lock(&chip->lock);
 	switch (mask) {
-	case 0:
+	case IIO_CHAN_INFO_RAW:
+	case IIO_CHAN_INFO_PROCESSED:
 		switch (chan->type) {
 		case IIO_LIGHT:
 			ret = isl29028_als_get(chip, val);
@@ -391,12 +392,15 @@ static const struct iio_chan_spec isl29028_channels[] = {
 	{
 		.type = IIO_LIGHT,
 		.processed_val = 1,
-		.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
+		.info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT |
+		IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
 	}, {
 		.type = IIO_INTENSITY,
+		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
 	}, {
 		.type = IIO_PROXIMITY,
-		.info_mask = IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT,
+		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
+		IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT,
 	}
 };
 
-- 
1.7.9.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries
  2012-04-15 11:41 [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries Jonathan Cameron
@ 2012-04-15 13:42 ` Jonathan Cameron
  2012-04-15 15:31   ` Laxman Dewangan
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2012-04-15 13:42 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, device-drivers-devel, lars, ldewangan

On 04/15/2012 12:41 PM, Jonathan Cameron wrote:
> Precursor to making value read / write attribute optional.
> This one stands along as it merged just before the series
> doing all the other drivers.
> 
Note there is also a one line change to remove the processed_val line
in the obvious patch later in the series...

> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
> ---
> This driver crossed with review of these patches.  To test
> just apply it after the series 
> [PATCH 00/13 V2] IIO: Make the value attribute optional for channels
> 
> Fairly trivial case, but obviously I can't push out the removal
> of the old code until this is in place.  In the meantime I'll push
> the rest of the conversion patches to Greg.
> 
> 
>  drivers/staging/iio/light/isl29028.c |   10 +++++++---
>  1 file changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/staging/iio/light/isl29028.c b/drivers/staging/iio/light/isl29028.c
> index e705e45..5ef2d0d 100644
> --- a/drivers/staging/iio/light/isl29028.c
> +++ b/drivers/staging/iio/light/isl29028.c
> @@ -330,7 +330,8 @@ static int isl29028_read_raw(struct iio_dev *indio_dev,
>  
>  	mutex_lock(&chip->lock);
>  	switch (mask) {
> -	case 0:
> +	case IIO_CHAN_INFO_RAW:
> +	case IIO_CHAN_INFO_PROCESSED:
>  		switch (chan->type) {
>  		case IIO_LIGHT:
>  			ret = isl29028_als_get(chip, val);
> @@ -391,12 +392,15 @@ static const struct iio_chan_spec isl29028_channels[] = {
>  	{
>  		.type = IIO_LIGHT,
>  		.processed_val = 1,
> -		.info_mask = IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
> +		.info_mask = IIO_CHAN_INFO_PROCESSED_SEPARATE_BIT |
> +		IIO_CHAN_INFO_SCALE_SEPARATE_BIT,
>  	}, {
>  		.type = IIO_INTENSITY,
> +		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT,
>  	}, {
>  		.type = IIO_PROXIMITY,
> -		.info_mask = IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT,
> +		.info_mask = IIO_CHAN_INFO_RAW_SEPARATE_BIT |
> +		IIO_CHAN_INFO_SAMP_FREQ_SEPARATE_BIT,
>  	}
>  };
>  


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries
  2012-04-15 13:42 ` Jonathan Cameron
@ 2012-04-15 15:31   ` Laxman Dewangan
  2012-04-15 16:29     ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Laxman Dewangan @ 2012-04-15 15:31 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: linux-iio, device-drivers-devel, lars

On Sunday 15 April 2012 07:12 PM, Jonathan Cameron wrote:
> On 04/15/2012 12:41 PM, Jonathan Cameron wrote:
>> Precursor to making value read / write attribute optional.
>> This one stands along as it merged just before the series
>> doing all the other drivers.
>>
> Note there is also a one line change to remove the processed_val line
> in the obvious patch later in the series...
>
>> Signed-off-by: Jonathan Cameron<jic23@kernel.org>
>>

Acked-by: Laxman Dewangan <ldewangan@nvidia.com>

changes make more sense now.  I was thinking that what is mask 0 when I 
started this driver and after reading  other driver came to know about this.
>>   		switch (chan->type) {
>>   		case IIO_LIGHT:
>>   			ret = isl29028_als_get(chip, val);
>> @@ -391,12 +392,15 @@ static const struct iio_chan_spec isl29028_channels[] = {
>>   	{
>>   		.type = IIO_LIGHT,
>>   		.processed_val = 1,

processed_val should be removed here and already you have taken care.


-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries
  2012-04-15 15:31   ` Laxman Dewangan
@ 2012-04-15 16:29     ` Jonathan Cameron
  0 siblings, 0 replies; 4+ messages in thread
From: Jonathan Cameron @ 2012-04-15 16:29 UTC (permalink / raw)
  To: Laxman Dewangan; +Cc: Jonathan Cameron, linux-iio, device-drivers-devel, lars

On 04/15/2012 04:31 PM, Laxman Dewangan wrote:
> On Sunday 15 April 2012 07:12 PM, Jonathan Cameron wrote:
>> On 04/15/2012 12:41 PM, Jonathan Cameron wrote:
>>> Precursor to making value read / write attribute optional.
>>> This one stands along as it merged just before the series
>>> doing all the other drivers.
>>>
>> Note there is also a one line change to remove the processed_val line
>> in the obvious patch later in the series...
>>
>>> Signed-off-by: Jonathan Cameron<jic23@kernel.org>
>>>
> 
> Acked-by: Laxman Dewangan <ldewangan@nvidia.com>
Thanks for the fast response.  Now I can get this out before any other
drivers sneak past ;)
> 
> changes make more sense now.  I was thinking that what is mask 0 when I
> started this driver and after reading  other driver came to know about
> this.
Yup, it all got a bit ilogical in there. The wonders of code evolution.
>>>           switch (chan->type) {
>>>           case IIO_LIGHT:
>>>               ret = isl29028_als_get(chip, val);
>>> @@ -391,12 +392,15 @@ static const struct iio_chan_spec
>>> isl29028_channels[] = {
>>>       {
>>>           .type = IIO_LIGHT,
>>>           .processed_val = 1,
> 
> processed_val should be removed here and already you have taken care.
yup, that occurs 2 patches later to keep things working all the way
through the series.
> 
> 
> -----------------------------------------------------------------------------------
> 
> This email message is for the sole use of the intended recipient(s) and
> may contain
> confidential information.  Any unauthorized review, use, disclosure or
> distribution
> is prohibited.  If you are not the intended recipient, please contact
> the sender by
> reply email and destroy all copies of the original message.
> -----------------------------------------------------------------------------------
> 
> -- 
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-04-15 16:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-15 11:41 [PATCH] staging:iio:isl29028 Add IIO_CHAN_INFO_RAW/PROCESSED entries Jonathan Cameron
2012-04-15 13:42 ` Jonathan Cameron
2012-04-15 15:31   ` Laxman Dewangan
2012-04-15 16:29     ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.