linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] kmx61: Small cleanups
@ 2014-11-17 13:18 Daniel Baluta
  2014-11-17 13:18 ` [PATCH 1/2] kmx61: Use uscale instead of scale Daniel Baluta
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daniel Baluta @ 2014-11-17 13:18 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel

This is a small cleanup patchset, that:
	* makes it clear that kmx61 uses only the micro part of scale
	* use macro instead of hardcoded value for driver name

Jonathan, if you think it's worth it, these could be squased together with
the initial patch submitted in testing:
	61ef04a496 (iio: imu: Add support for Kionix KMX61 sensor)

Daniel Baluta (2):
  kmx61: Use uscale instead of scale
  kmx61: Use KMX61_DRV_NAME instead of hardcoded value

 drivers/iio/imu/kmx61.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
1.9.1


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

* [PATCH 1/2] kmx61: Use uscale instead of scale
  2014-11-17 13:18 [PATCH 0/2] kmx61: Small cleanups Daniel Baluta
@ 2014-11-17 13:18 ` Daniel Baluta
  2014-11-17 13:18 ` [PATCH 2/2] kmx61: Use KMX61_DRV_NAME instead of hardcoded value Daniel Baluta
  2014-11-17 14:59 ` [PATCH 0/2] kmx61: Small cleanups Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Baluta @ 2014-11-17 13:18 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel

This makes it easier to notice that we only use
the micro part for scale.

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 drivers/iio/imu/kmx61.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
index 2bd77dd..e49b1cc 100644
--- a/drivers/iio/imu/kmx61.c
+++ b/drivers/iio/imu/kmx61.c
@@ -90,7 +90,7 @@ enum kmx61_scan {
 };
 
 static const struct {
-	u16 scale;
+	u16 uscale;
 	u8 gsel0;
 	u8 gsel1;
 } kmx61_scale_table[] = {
@@ -337,13 +337,13 @@ static int kmx61_set_range(struct kmx61_data *data, int range)
 	return 0;
 }
 
-static int kmx61_set_scale(struct kmx61_data *data, int val)
+static int kmx61_set_scale(struct kmx61_data *data, int uscale)
 {
 	int ret, i;
 	u8  mode;
 
 	for (i = 0; i < ARRAY_SIZE(kmx61_scale_table); i++) {
-		if (kmx61_scale_table[i].scale == val) {
+		if (kmx61_scale_table[i].uscale == uscale) {
 			ret = kmx61_get_mode(data, &mode,
 					     KMX61_ACC | KMX61_MAG);
 			if (ret < 0)
@@ -441,7 +441,7 @@ static int kmx61_read_raw(struct iio_dev *indio_dev,
 		switch (chan->type) {
 		case IIO_ACCEL:
 			*val = 0;
-			*val2 = kmx61_scale_table[data->range].scale;
+			*val2 = kmx61_scale_table[data->range].uscale;
 			return IIO_VAL_INT_PLUS_MICRO;
 		case IIO_MAGN:
 			/* 14 bits res, 1465 microGauss per magn count */
-- 
1.9.1


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

* [PATCH 2/2] kmx61: Use KMX61_DRV_NAME instead of hardcoded value
  2014-11-17 13:18 [PATCH 0/2] kmx61: Small cleanups Daniel Baluta
  2014-11-17 13:18 ` [PATCH 1/2] kmx61: Use uscale instead of scale Daniel Baluta
@ 2014-11-17 13:18 ` Daniel Baluta
  2014-11-17 14:59 ` [PATCH 0/2] kmx61: Small cleanups Jonathan Cameron
  2 siblings, 0 replies; 6+ messages in thread
From: Daniel Baluta @ 2014-11-17 13:18 UTC (permalink / raw)
  To: jic23; +Cc: linux-iio, linux-kernel

Signed-off-by: Daniel Baluta <daniel.baluta@intel.com>
---
 drivers/iio/imu/kmx61.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/iio/imu/kmx61.c b/drivers/iio/imu/kmx61.c
index e49b1cc..8c4b365 100644
--- a/drivers/iio/imu/kmx61.c
+++ b/drivers/iio/imu/kmx61.c
@@ -578,7 +578,7 @@ MODULE_DEVICE_TABLE(i2c, kmx61_id);
 
 static struct i2c_driver kmx61_driver = {
 	.driver = {
-		.name = "kmx61",
+		.name = KMX61_DRV_NAME,
 	},
 	.probe		= kmx61_probe,
 	.remove		= kmx61_remove,
-- 
1.9.1


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

* Re: [PATCH 0/2] kmx61: Small cleanups
  2014-11-17 13:18 [PATCH 0/2] kmx61: Small cleanups Daniel Baluta
  2014-11-17 13:18 ` [PATCH 1/2] kmx61: Use uscale instead of scale Daniel Baluta
  2014-11-17 13:18 ` [PATCH 2/2] kmx61: Use KMX61_DRV_NAME instead of hardcoded value Daniel Baluta
@ 2014-11-17 14:59 ` Jonathan Cameron
  2014-11-17 15:09   ` Daniel Baluta
  2 siblings, 1 reply; 6+ messages in thread
From: Jonathan Cameron @ 2014-11-17 14:59 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: linux-iio, linux-kernel



On November 17, 2014 1:18:34 PM GMT+00:00, Daniel Baluta <daniel.baluta@intel.com> wrote:
>This is a small cleanup patchset, that:
>	* makes it clear that kmx61 uses only the micro part of scale
>	* use macro instead of hardcoded value for driver name
>
>Jonathan, if you think it's worth it, these could be squased together
>with
>the initial patch submitted in testing:
>	61ef04a496 (iio: imu: Add support for Kionix KMX61 sensor)
>

Given the additional bits from Peter, I don't mind pulling the original and applying an updated patch.

Additional changes like this are fine as well if you prefer.

J
>Daniel Baluta (2):
>  kmx61: Use uscale instead of scale
>  kmx61: Use KMX61_DRV_NAME instead of hardcoded value
>
> drivers/iio/imu/kmx61.c | 10 +++++-----
> 1 file changed, 5 insertions(+), 5 deletions(-)

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

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

* Re: [PATCH 0/2] kmx61: Small cleanups
  2014-11-17 14:59 ` [PATCH 0/2] kmx61: Small cleanups Jonathan Cameron
@ 2014-11-17 15:09   ` Daniel Baluta
  2014-11-22 11:49     ` Jonathan Cameron
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Baluta @ 2014-11-17 15:09 UTC (permalink / raw)
  To: Jonathan Cameron; +Cc: Daniel Baluta, linux-iio, Linux Kernel Mailing List

On Mon, Nov 17, 2014 at 4:59 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>
>
> On November 17, 2014 1:18:34 PM GMT+00:00, Daniel Baluta <daniel.baluta@intel.com> wrote:
>>This is a small cleanup patchset, that:
>>       * makes it clear that kmx61 uses only the micro part of scale
>>       * use macro instead of hardcoded value for driver name
>>
>>Jonathan, if you think it's worth it, these could be squased together
>>with
>>the initial patch submitted in testing:
>>       61ef04a496 (iio: imu: Add support for Kionix KMX61 sensor)
>>
>
> Given the additional bits from Peter, I don't mind pulling the original and applying an updated patch.

I prefer this :). I will send an updated patch with fixes reported by Peter.

>
> Additional changes like this are fine as well if you prefer.

I am almost done with adding support for runtime PM. Let me know
if you want this as a separate patch or just one big updated patch.

Daniel.

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

* Re: [PATCH 0/2] kmx61: Small cleanups
  2014-11-17 15:09   ` Daniel Baluta
@ 2014-11-22 11:49     ` Jonathan Cameron
  0 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2014-11-22 11:49 UTC (permalink / raw)
  To: Daniel Baluta; +Cc: linux-iio, Linux Kernel Mailing List

On 17/11/14 15:09, Daniel Baluta wrote:
> On Mon, Nov 17, 2014 at 4:59 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>>
>>
>> On November 17, 2014 1:18:34 PM GMT+00:00, Daniel Baluta <daniel.baluta@intel.com> wrote:
>>> This is a small cleanup patchset, that:
>>>       * makes it clear that kmx61 uses only the micro part of scale
>>>       * use macro instead of hardcoded value for driver name
>>>
>>> Jonathan, if you think it's worth it, these could be squased together
>>> with
>>> the initial patch submitted in testing:
>>>       61ef04a496 (iio: imu: Add support for Kionix KMX61 sensor)
>>>
>>
>> Given the additional bits from Peter, I don't mind pulling the original and applying an updated patch.
> 
> I prefer this :). I will send an updated patch with fixes reported by Peter.
> 
>>
>> Additional changes like this are fine as well if you prefer.
> 
> I am almost done with adding support for runtime PM. Let me know
> if you want this as a separate patch or just one big updated patch.
Oops. I moaned about the unified patch, but didn't actually get around
to replying to you.  Was fine either way really.

Note to anyone reading this patch series - the unified patch for
adding the driver with all these changes in place has now been applied.

Jonathan
> 
> Daniel.
> 


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

end of thread, other threads:[~2014-11-22 11:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-17 13:18 [PATCH 0/2] kmx61: Small cleanups Daniel Baluta
2014-11-17 13:18 ` [PATCH 1/2] kmx61: Use uscale instead of scale Daniel Baluta
2014-11-17 13:18 ` [PATCH 2/2] kmx61: Use KMX61_DRV_NAME instead of hardcoded value Daniel Baluta
2014-11-17 14:59 ` [PATCH 0/2] kmx61: Small cleanups Jonathan Cameron
2014-11-17 15:09   ` Daniel Baluta
2014-11-22 11:49     ` Jonathan Cameron

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).