* [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver
@ 2015-04-15 20:39 Peter Meerwald
2015-04-15 20:39 ` [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions Peter Meerwald
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Peter Meerwald @ 2015-04-15 20:39 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, Peter Meerwald
just cleanup, no functional change
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
drivers/iio/light/tsl4531.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
index 0763b86..63c26e2 100644
--- a/drivers/iio/light/tsl4531.c
+++ b/drivers/iio/light/tsl4531.c
@@ -24,12 +24,12 @@
#define TSL4531_DRV_NAME "tsl4531"
-#define TCS3472_COMMAND BIT(7)
+#define TSL4531_COMMAND BIT(7)
-#define TSL4531_CONTROL (TCS3472_COMMAND | 0x00)
-#define TSL4531_CONFIG (TCS3472_COMMAND | 0x01)
-#define TSL4531_DATA (TCS3472_COMMAND | 0x04)
-#define TSL4531_ID (TCS3472_COMMAND | 0x0a)
+#define TSL4531_CONTROL (TSL4531_COMMAND | 0x00)
+#define TSL4531_CONFIG (TSL4531_COMMAND | 0x01)
+#define TSL4531_DATA (TSL4531_COMMAND | 0x04)
+#define TSL4531_ID (TSL4531_COMMAND | 0x0a)
/* operating modes in control register */
#define TSL4531_MODE_POWERDOWN 0x00
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions
2015-04-15 20:39 [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Peter Meerwald
@ 2015-04-15 20:39 ` Peter Meerwald
2015-04-18 19:35 ` Jonathan Cameron
2015-04-15 20:39 ` [PATCH] iio:tmp006: Prefix #defines with TMP006_ Peter Meerwald
2015-04-16 8:28 ` [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Daniel Baluta
2 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2015-04-15 20:39 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, Peter Meerwald
just cleanup, no functional change
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
drivers/iio/light/tsl2563.c | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
index 94daa9f..8166944 100644
--- a/drivers/iio/light/tsl2563.c
+++ b/drivers/iio/light/tsl2563.c
@@ -240,7 +240,7 @@ static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id)
* convert between normalized values and HW values obtained using given
* timing and gain settings.
*/
-static int adc_shiftbits(u8 timing)
+static int tsl2563_adc_shiftbits(u8 timing)
{
int shift = 0;
@@ -263,9 +263,9 @@ static int adc_shiftbits(u8 timing)
}
/* Convert a HW ADC value to normalized scale. */
-static u32 normalize_adc(u16 adc, u8 timing)
+static u32 tsl2563_normalize_adc(u16 adc, u8 timing)
{
- return adc << adc_shiftbits(timing);
+ return adc << tsl2563_adc_shiftbits(timing);
}
static void tsl2563_wait_adc(struct tsl2563_chip *chip)
@@ -350,8 +350,8 @@ static int tsl2563_get_adc(struct tsl2563_chip *chip)
retry = tsl2563_adjust_gainlevel(chip, adc0);
}
- chip->data0 = normalize_adc(adc0, chip->gainlevel->gaintime);
- chip->data1 = normalize_adc(adc1, chip->gainlevel->gaintime);
+ chip->data0 = tsl2563_normalize_adc(adc0, chip->gainlevel->gaintime);
+ chip->data1 = tsl2563_normalize_adc(adc1, chip->gainlevel->gaintime);
if (!chip->int_enabled)
schedule_delayed_work(&chip->poweroff_work, 5 * HZ);
@@ -361,13 +361,13 @@ out:
return ret;
}
-static inline int calib_to_sysfs(u32 calib)
+static inline int tsl2563_calib_to_sysfs(u32 calib)
{
return (int) (((calib * CALIB_BASE_SYSFS) +
CALIB_FRAC_HALF) >> CALIB_FRAC_BITS);
}
-static inline u32 calib_from_sysfs(int value)
+static inline u32 tsl2563_calib_from_sysfs(int value)
{
return (((u32) value) << CALIB_FRAC_BITS) / CALIB_BASE_SYSFS;
}
@@ -426,7 +426,7 @@ static const struct tsl2563_lux_coeff lux_table[] = {
};
/* Convert normalized, scaled ADC values to lux. */
-static unsigned int adc_to_lux(u32 adc0, u32 adc1)
+static unsigned int tsl2563_adc_to_lux(u32 adc0, u32 adc1)
{
const struct tsl2563_lux_coeff *lp = lux_table;
unsigned long ratio, lux, ch0 = adc0, ch1 = adc1;
@@ -442,7 +442,7 @@ static unsigned int adc_to_lux(u32 adc0, u32 adc1)
}
/* Apply calibration coefficient to ADC count. */
-static u32 calib_adc(u32 adc, u32 calib)
+static u32 tsl2563_calib_adc(u32 adc, u32 calib)
{
unsigned long scaled = adc;
@@ -463,9 +463,9 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
if (mask != IIO_CHAN_INFO_CALIBSCALE)
return -EINVAL;
if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
- chip->calib0 = calib_from_sysfs(val);
+ chip->calib0 = tsl2563_calib_from_sysfs(val);
else if (chan->channel2 == IIO_MOD_LIGHT_IR)
- chip->calib1 = calib_from_sysfs(val);
+ chip->calib1 = tsl2563_calib_from_sysfs(val);
else
return -EINVAL;
@@ -491,11 +491,11 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
ret = tsl2563_get_adc(chip);
if (ret)
goto error_ret;
- calib0 = calib_adc(chip->data0, chip->calib0) *
+ calib0 = tsl2563_calib_adc(chip->data0, chip->calib0) *
chip->cover_comp_gain;
- calib1 = calib_adc(chip->data1, chip->calib1) *
+ calib1 = tsl2563_calib_adc(chip->data1, chip->calib1) *
chip->cover_comp_gain;
- *val = adc_to_lux(calib0, calib1);
+ *val = tsl2563_adc_to_lux(calib0, calib1);
ret = IIO_VAL_INT;
break;
case IIO_INTENSITY:
@@ -515,9 +515,9 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
case IIO_CHAN_INFO_CALIBSCALE:
if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
- *val = calib_to_sysfs(chip->calib0);
+ *val = tsl2563_calib_to_sysfs(chip->calib0);
else
- *val = calib_to_sysfs(chip->calib1);
+ *val = tsl2563_calib_to_sysfs(chip->calib1);
ret = IIO_VAL_INT;
break;
default:
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH] iio:tmp006: Prefix #defines with TMP006_
2015-04-15 20:39 [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Peter Meerwald
2015-04-15 20:39 ` [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions Peter Meerwald
@ 2015-04-15 20:39 ` Peter Meerwald
2015-04-18 19:36 ` Jonathan Cameron
2015-04-16 8:28 ` [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Daniel Baluta
2 siblings, 1 reply; 7+ messages in thread
From: Peter Meerwald @ 2015-04-15 20:39 UTC (permalink / raw)
To: linux-iio; +Cc: jic23, Peter Meerwald
just cleanup, no functional change
Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
---
drivers/iio/temperature/tmp006.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
index 84a0789..fcc49f8 100644
--- a/drivers/iio/temperature/tmp006.c
+++ b/drivers/iio/temperature/tmp006.c
@@ -41,8 +41,8 @@
#define TMP006_CONFIG_CR_MASK 0x0e00
#define TMP006_CONFIG_CR_SHIFT 9
-#define MANUFACTURER_MAGIC 0x5449
-#define DEVICE_MAGIC 0x0067
+#define TMP006_MANUFACTURER_MAGIC 0x5449
+#define TMP006_DEVICE_MAGIC 0x0067
struct tmp006_data {
struct i2c_client *client;
@@ -191,7 +191,7 @@ static bool tmp006_check_identification(struct i2c_client *client)
if (did < 0)
return false;
- return mid == MANUFACTURER_MAGIC && did == DEVICE_MAGIC;
+ return mid == TMP006_MANUFACTURER_MAGIC && did == TMP006_DEVICE_MAGIC;
}
static int tmp006_probe(struct i2c_client *client,
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver
2015-04-15 20:39 [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Peter Meerwald
2015-04-15 20:39 ` [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions Peter Meerwald
2015-04-15 20:39 ` [PATCH] iio:tmp006: Prefix #defines with TMP006_ Peter Meerwald
@ 2015-04-16 8:28 ` Daniel Baluta
2015-04-18 19:32 ` Jonathan Cameron
2 siblings, 1 reply; 7+ messages in thread
From: Daniel Baluta @ 2015-04-16 8:28 UTC (permalink / raw)
To: Peter Meerwald, linux-iio; +Cc: jic23
On 04/15/2015 11:39 PM, Peter Meerwald wrote:
> just cleanup, no functional change
Commit message tag should be now "iio: tsl4531: ". Other than that
it looks good to me.
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
> ---
> drivers/iio/light/tsl4531.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
> index 0763b86..63c26e2 100644
> --- a/drivers/iio/light/tsl4531.c
> +++ b/drivers/iio/light/tsl4531.c
> @@ -24,12 +24,12 @@
>
> #define TSL4531_DRV_NAME "tsl4531"
>
> -#define TCS3472_COMMAND BIT(7)
> +#define TSL4531_COMMAND BIT(7)
>
> -#define TSL4531_CONTROL (TCS3472_COMMAND | 0x00)
> -#define TSL4531_CONFIG (TCS3472_COMMAND | 0x01)
> -#define TSL4531_DATA (TCS3472_COMMAND | 0x04)
> -#define TSL4531_ID (TCS3472_COMMAND | 0x0a)
> +#define TSL4531_CONTROL (TSL4531_COMMAND | 0x00)
> +#define TSL4531_CONFIG (TSL4531_COMMAND | 0x01)
> +#define TSL4531_DATA (TSL4531_COMMAND | 0x04)
> +#define TSL4531_ID (TSL4531_COMMAND | 0x0a)
>
> /* operating modes in control register */
> #define TSL4531_MODE_POWERDOWN 0x00
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver
2015-04-16 8:28 ` [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Daniel Baluta
@ 2015-04-18 19:32 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2015-04-18 19:32 UTC (permalink / raw)
To: Daniel Baluta, Peter Meerwald, linux-iio
On 16/04/15 09:28, Daniel Baluta wrote:
>
>
> On 04/15/2015 11:39 PM, Peter Meerwald wrote:
>> just cleanup, no functional change
>
> Commit message tag should be now "iio: tsl4531: ". Other than that
> it looks good to me.
>
Good spot to both of you ;)
Anyhow, applied with patch title fixed to the togreg branch of iio.git.
Thanks,
>
>>
>> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
>> ---
>> drivers/iio/light/tsl4531.c | 10 +++++-----
>> 1 file changed, 5 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/iio/light/tsl4531.c b/drivers/iio/light/tsl4531.c
>> index 0763b86..63c26e2 100644
>> --- a/drivers/iio/light/tsl4531.c
>> +++ b/drivers/iio/light/tsl4531.c
>> @@ -24,12 +24,12 @@
>>
>> #define TSL4531_DRV_NAME "tsl4531"
>>
>> -#define TCS3472_COMMAND BIT(7)
>> +#define TSL4531_COMMAND BIT(7)
>>
>> -#define TSL4531_CONTROL (TCS3472_COMMAND | 0x00)
>> -#define TSL4531_CONFIG (TCS3472_COMMAND | 0x01)
>> -#define TSL4531_DATA (TCS3472_COMMAND | 0x04)
>> -#define TSL4531_ID (TCS3472_COMMAND | 0x0a)
>> +#define TSL4531_CONTROL (TSL4531_COMMAND | 0x00)
>> +#define TSL4531_CONFIG (TSL4531_COMMAND | 0x01)
>> +#define TSL4531_DATA (TSL4531_COMMAND | 0x04)
>> +#define TSL4531_ID (TSL4531_COMMAND | 0x0a)
>>
>> /* operating modes in control register */
>> #define TSL4531_MODE_POWERDOWN 0x00
>>
> --
> 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] 7+ messages in thread
* Re: [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions
2015-04-15 20:39 ` [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions Peter Meerwald
@ 2015-04-18 19:35 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2015-04-18 19:35 UTC (permalink / raw)
To: Peter Meerwald, linux-iio
On 15/04/15 21:39, Peter Meerwald wrote:
> just cleanup, no functional change
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
Applied with the small issue you left in to check I was awake fixed.
There are to more calib_to_sys calls that you didn't update.
> ---
> drivers/iio/light/tsl2563.c | 32 ++++++++++++++++----------------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/iio/light/tsl2563.c b/drivers/iio/light/tsl2563.c
> index 94daa9f..8166944 100644
> --- a/drivers/iio/light/tsl2563.c
> +++ b/drivers/iio/light/tsl2563.c
> @@ -240,7 +240,7 @@ static int tsl2563_read_id(struct tsl2563_chip *chip, u8 *id)
> * convert between normalized values and HW values obtained using given
> * timing and gain settings.
> */
> -static int adc_shiftbits(u8 timing)
> +static int tsl2563_adc_shiftbits(u8 timing)
> {
> int shift = 0;
>
> @@ -263,9 +263,9 @@ static int adc_shiftbits(u8 timing)
> }
>
> /* Convert a HW ADC value to normalized scale. */
> -static u32 normalize_adc(u16 adc, u8 timing)
> +static u32 tsl2563_normalize_adc(u16 adc, u8 timing)
> {
> - return adc << adc_shiftbits(timing);
> + return adc << tsl2563_adc_shiftbits(timing);
> }
>
> static void tsl2563_wait_adc(struct tsl2563_chip *chip)
> @@ -350,8 +350,8 @@ static int tsl2563_get_adc(struct tsl2563_chip *chip)
> retry = tsl2563_adjust_gainlevel(chip, adc0);
> }
>
> - chip->data0 = normalize_adc(adc0, chip->gainlevel->gaintime);
> - chip->data1 = normalize_adc(adc1, chip->gainlevel->gaintime);
> + chip->data0 = tsl2563_normalize_adc(adc0, chip->gainlevel->gaintime);
> + chip->data1 = tsl2563_normalize_adc(adc1, chip->gainlevel->gaintime);
>
> if (!chip->int_enabled)
> schedule_delayed_work(&chip->poweroff_work, 5 * HZ);
> @@ -361,13 +361,13 @@ out:
> return ret;
> }
>
> -static inline int calib_to_sysfs(u32 calib)
> +static inline int tsl2563_calib_to_sysfs(u32 calib)
> {
> return (int) (((calib * CALIB_BASE_SYSFS) +
> CALIB_FRAC_HALF) >> CALIB_FRAC_BITS);
> }
>
> -static inline u32 calib_from_sysfs(int value)
> +static inline u32 tsl2563_calib_from_sysfs(int value)
> {
> return (((u32) value) << CALIB_FRAC_BITS) / CALIB_BASE_SYSFS;
> }
> @@ -426,7 +426,7 @@ static const struct tsl2563_lux_coeff lux_table[] = {
> };
>
> /* Convert normalized, scaled ADC values to lux. */
> -static unsigned int adc_to_lux(u32 adc0, u32 adc1)
> +static unsigned int tsl2563_adc_to_lux(u32 adc0, u32 adc1)
> {
> const struct tsl2563_lux_coeff *lp = lux_table;
> unsigned long ratio, lux, ch0 = adc0, ch1 = adc1;
> @@ -442,7 +442,7 @@ static unsigned int adc_to_lux(u32 adc0, u32 adc1)
> }
>
> /* Apply calibration coefficient to ADC count. */
> -static u32 calib_adc(u32 adc, u32 calib)
> +static u32 tsl2563_calib_adc(u32 adc, u32 calib)
> {
> unsigned long scaled = adc;
>
> @@ -463,9 +463,9 @@ static int tsl2563_write_raw(struct iio_dev *indio_dev,
> if (mask != IIO_CHAN_INFO_CALIBSCALE)
> return -EINVAL;
> if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
> - chip->calib0 = calib_from_sysfs(val);
> + chip->calib0 = tsl2563_calib_from_sysfs(val);
> else if (chan->channel2 == IIO_MOD_LIGHT_IR)
> - chip->calib1 = calib_from_sysfs(val);
> + chip->calib1 = tsl2563_calib_from_sysfs(val);
> else
> return -EINVAL;
>
> @@ -491,11 +491,11 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
> ret = tsl2563_get_adc(chip);
> if (ret)
> goto error_ret;
> - calib0 = calib_adc(chip->data0, chip->calib0) *
> + calib0 = tsl2563_calib_adc(chip->data0, chip->calib0) *
> chip->cover_comp_gain;
> - calib1 = calib_adc(chip->data1, chip->calib1) *
> + calib1 = tsl2563_calib_adc(chip->data1, chip->calib1) *
> chip->cover_comp_gain;
> - *val = adc_to_lux(calib0, calib1);
> + *val = tsl2563_adc_to_lux(calib0, calib1);
> ret = IIO_VAL_INT;
> break;
> case IIO_INTENSITY:
> @@ -515,9 +515,9 @@ static int tsl2563_read_raw(struct iio_dev *indio_dev,
>
> case IIO_CHAN_INFO_CALIBSCALE:
> if (chan->channel2 == IIO_MOD_LIGHT_BOTH)
> - *val = calib_to_sysfs(chip->calib0);
> + *val = tsl2563_calib_to_sysfs(chip->calib0);
> else
> - *val = calib_to_sysfs(chip->calib1);
> + *val = tsl2563_calib_to_sysfs(chip->calib1);
> ret = IIO_VAL_INT;
> break;
> default:
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] iio:tmp006: Prefix #defines with TMP006_
2015-04-15 20:39 ` [PATCH] iio:tmp006: Prefix #defines with TMP006_ Peter Meerwald
@ 2015-04-18 19:36 ` Jonathan Cameron
0 siblings, 0 replies; 7+ messages in thread
From: Jonathan Cameron @ 2015-04-18 19:36 UTC (permalink / raw)
To: Peter Meerwald, linux-iio
On 15/04/15 21:39, Peter Meerwald wrote:
> just cleanup, no functional change
>
> Signed-off-by: Peter Meerwald <pmeerw@pmeerw.net>
applied.
> ---
> drivers/iio/temperature/tmp006.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/iio/temperature/tmp006.c b/drivers/iio/temperature/tmp006.c
> index 84a0789..fcc49f8 100644
> --- a/drivers/iio/temperature/tmp006.c
> +++ b/drivers/iio/temperature/tmp006.c
> @@ -41,8 +41,8 @@
> #define TMP006_CONFIG_CR_MASK 0x0e00
> #define TMP006_CONFIG_CR_SHIFT 9
>
> -#define MANUFACTURER_MAGIC 0x5449
> -#define DEVICE_MAGIC 0x0067
> +#define TMP006_MANUFACTURER_MAGIC 0x5449
> +#define TMP006_DEVICE_MAGIC 0x0067
>
> struct tmp006_data {
> struct i2c_client *client;
> @@ -191,7 +191,7 @@ static bool tmp006_check_identification(struct i2c_client *client)
> if (did < 0)
> return false;
>
> - return mid == MANUFACTURER_MAGIC && did == DEVICE_MAGIC;
> + return mid == TMP006_MANUFACTURER_MAGIC && did == TMP006_DEVICE_MAGIC;
> }
>
> static int tmp006_probe(struct i2c_client *client,
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2015-04-18 19:36 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-15 20:39 [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Peter Meerwald
2015-04-15 20:39 ` [PATCH] iio:tsl2563: Use tsl2563_ prefix for driver's functions Peter Meerwald
2015-04-18 19:35 ` Jonathan Cameron
2015-04-15 20:39 ` [PATCH] iio:tmp006: Prefix #defines with TMP006_ Peter Meerwald
2015-04-18 19:36 ` Jonathan Cameron
2015-04-16 8:28 ` [PATCH] iio:tcs4531: Fix leftover TCS3472_ prefix in tsl4531 driver Daniel Baluta
2015-04-18 19:32 ` 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.