Skip to contentSkip to conversation

iio:light:ltr501: fix variable in ltr501_init

PATCH In review Hartmut Knaack 3 participants 6 messages Jun 28, 2015 – Jul 5, 2015 1 message not in the archive IIO

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH 1/2 iio:light:ltr501: fix regmap dependency

The use of regmap in commit [1] requires REGMAP_I2C to be selected, in order to meet all dependencies.

[1] 2f2c96338afc9f90aa5a0fca04ece1a5c389ee31
"iio: ltr501: Add regmap support."

---
 drivers/iio/light/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/Kconfig +1 -0
index 730fa80..1f1e103 100644
@@ -199,6 +199,7 @@ config SENSORS_LM3533
 config LTR501
 	tristate "LTR-501ALS-01 light sensor"
 	depends on I2C
+	select REGMAP_I2C
 	select IIO_BUFFER
 	select IIO_TRIGGERED_BUFFER
 	help
Signature · 1 line
2.3.6
Acked-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] iio:light:ltr501: fix regmap dependency

Quoted 5 lines · Hartmut Knaack

The use of regmap in commit [1] requires REGMAP_I2C to be selected, in order to meet all dependencies.

[1] 2f2c96338afc9f90aa5a0fca04ece1a5c389ee31
"iio: ltr501: Add regmap support."

The standard way to do this is:

Fixes 2f2c96338afc ("iio: ltr501: Add regmap support.")
Quoted 2 lines

Otherwise,

Quoted 23 lines
---
 drivers/iio/light/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/Kconfig +1 -1
index 730fa80..1f1e103 100644
@@ -199,6 +199,7 @@ config SENSORS_LM3533
 config LTR501
        tristate "LTR-501ALS-01 light sensor"
        depends on I2C
+       select REGMAP_I2C
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
        help
--

2.3.6

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

maintainer
#3 lore raw

Re: [PATCH 1/2] iio:light:ltr501: fix regmap dependency

Quoted 9 lines · Daniel Baluta
Quoted 5 lines · Hartmut Knaack

The use of regmap in commit [1] requires REGMAP_I2C to be selected, in order to meet all dependencies.

[1] 2f2c96338afc9f90aa5a0fca04ece1a5c389ee31
"iio: ltr501: Add regmap support."

The standard way to do this is:

Quoted 8 lines
Fixes 2f2c96338afc ("iio: ltr501: Add regmap support.")
Quoted 2 lines

Otherwise,

Hmm. My filters had eaten this patch for some reason...

Anyhow, dug it out and applied.

Hopefully nothing else has gone missing!

Jonathan

Quoted 29 lines
Quoted 20 lines
---
 drivers/iio/light/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/iio/light/Kconfig +1 -1
index 730fa80..1f1e103 100644
@@ -199,6 +199,7 @@ config SENSORS_LM3533
 config LTR501
        tristate "LTR-501ALS-01 light sensor"
        depends on I2C
+       select REGMAP_I2C
        select IIO_BUFFER
        select IIO_TRIGGERED_BUFFER
        help
--

2.3.6

Quoted 4 lines

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

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

#4 lore raw

PATCH 2/2 iio:light:ltr501: fix variable in ltr501_init

In reply to a message not in the archive

When filling data->als_contr, the register content read into status needs to be used, instead of the return status value of regmap_read.

This fixes: 8592a7eefa540303dd9e60fa49340d09ca9376b4
"iio: ltr501: Add support for ltr559 chip"

---
 drivers/iio/light/ltr501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/ltr501.c +1 -1
index 1ef7d37..b5a0e66 100644
@@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data)
 	if (ret < 0)
 		return ret;
 
-	data->als_contr = ret | data->chip_info->als_mode_active;
+	data->als_contr = status | data->chip_info->als_mode_active;
 
 	ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status);
 	if (ret < 0)
Signature · 1 line
2.3.6
#5 lore raw
Quoted 6 lines · Hartmut Knaack

When filling data->als_contr, the register content read into status needs to be used, instead of the return status value of regmap_read.

This fixes: 8592a7eefa540303dd9e60fa49340d09ca9376b4
"iio: ltr501: Add support for ltr559 chip"

Ditto, as per previous patch:

Fixes 8592a7eefa540 ("iio: ltr501: Add support for ltr559 chip")

Also, I'm pretty sure that checkpatch.pl should have warned you about this.

Quoted 25 lines
---
 drivers/iio/light/ltr501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/ltr501.c +1 -2
index 1ef7d37..b5a0e66 100644
@@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data)
        if (ret < 0)
                return ret;
 
-       data->als_contr = ret | data->chip_info->als_mode_active;
+       data->als_contr = status | data->chip_info->als_mode_active;
 
        ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status);
        if (ret < 0)
--

2.3.6

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

#6 lore raw

Daniel Baluta schrieb am 29.06.2015 um 09:57:

Quoted 8 lines · Hartmut Knaack
Quoted 6 lines

When filling data->als_contr, the register content read into status needs to be used, instead of the return status value of regmap_read.

This fixes: 8592a7eefa540303dd9e60fa49340d09ca9376b4
"iio: ltr501: Add support for ltr559 chip"

Quoted 7 lines

Ditto, as per previous patch:

Fixes 8592a7eefa540 ("iio: ltr501: Add support for ltr559 chip")

Also, I'm pretty sure that checkpatch.pl should have warned you about this.

Unfortunately it doesn't. But I will keep it in mind.

Quoted 30 lines
Quoted 21 lines
---
 drivers/iio/light/ltr501.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iio/light/ltr501.c +1 -2
index 1ef7d37..b5a0e66 100644
@@ -1302,7 +1302,7 @@ static int ltr501_init(struct ltr501_data *data)
        if (ret < 0)
                return ret;
 
-       data->als_contr = ret | data->chip_info->als_mode_active;
+       data->als_contr = status | data->chip_info->als_mode_active;
 
        ret = regmap_read(data->regmap, LTR501_PS_CONTR, &status);
        if (ret < 0)
--

2.3.6

Quoted 4 lines

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

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