All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] iio: accel: mxc6255 add support for the mxc6225
@ 2016-09-04 17:35 Hans de Goede
  2016-09-05 20:19 ` Jonathan Cameron
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2016-09-04 17:35 UTC (permalink / raw
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Teodora Baluta
  Cc: linux-iio, Hans de Goede

The mxc6225 is fully compatible with the existing mxc6255 driver,
add support for it.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
 drivers/iio/accel/mxc6255.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/iio/accel/mxc6255.c b/drivers/iio/accel/mxc6255.c
index 97ccde7..50343a7 100644
--- a/drivers/iio/accel/mxc6255.c
+++ b/drivers/iio/accel/mxc6255.c
@@ -26,6 +26,7 @@
 #define MXC6255_REG_YOUT		0x01
 #define MXC6255_REG_CHIP_ID		0x08
 
+#define MXC6225_CHIP_ID			0xe5
 #define MXC6255_CHIP_ID			0x05
 
 /*
@@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
 		return ret;
 	}
 
-	if (chip_id != MXC6255_CHIP_ID) {
+	switch (chip_id) {
+	case MXC6225_CHIP_ID:
+	case MXC6255_CHIP_ID:
+		break;
+	default:
 		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
 		return -ENODEV;
 	}
@@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
 }
 
 static const struct acpi_device_id mxc6255_acpi_match[] = {
+	{"MXC6225",	0},
 	{"MXC6255",	0},
 	{ }
 };
 MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
 
 static const struct i2c_device_id mxc6255_id[] = {
+	{"mxc6225",	0},
 	{"mxc6255",	0},
 	{ }
 };
-- 
2.9.3


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

* Re: [PATCH] iio: accel: mxc6255 add support for the mxc6225
  2016-09-04 17:35 [PATCH] iio: accel: mxc6255 add support for the mxc6225 Hans de Goede
@ 2016-09-05 20:19 ` Jonathan Cameron
  2016-09-06  7:44   ` Hans de Goede
  0 siblings, 1 reply; 4+ messages in thread
From: Jonathan Cameron @ 2016-09-05 20:19 UTC (permalink / raw
  To: Hans de Goede, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Teodora Baluta
  Cc: linux-iio

On 04/09/16 18:35, Hans de Goede wrote:
> The mxc6225 is fully compatible with the existing mxc6255 driver,
> add support for it.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Ah well. Can't find any docs on this on via google so I'll take
your word for it :)

Applied to the togreg branch of iio.git and pushed out as testing
for the autobuilders to play with it.

Thanks,

Jonathan
> ---
>  drivers/iio/accel/mxc6255.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/iio/accel/mxc6255.c b/drivers/iio/accel/mxc6255.c
> index 97ccde7..50343a7 100644
> --- a/drivers/iio/accel/mxc6255.c
> +++ b/drivers/iio/accel/mxc6255.c
> @@ -26,6 +26,7 @@
>  #define MXC6255_REG_YOUT		0x01
>  #define MXC6255_REG_CHIP_ID		0x08
>  
> +#define MXC6225_CHIP_ID			0xe5
>  #define MXC6255_CHIP_ID			0x05
>  
>  /*
> @@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
>  		return ret;
>  	}
>  
> -	if (chip_id != MXC6255_CHIP_ID) {
> +	switch (chip_id) {
> +	case MXC6225_CHIP_ID:
> +	case MXC6255_CHIP_ID:
> +		break;
> +	default:
>  		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
>  		return -ENODEV;
>  	}
> @@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
>  }
>  
>  static const struct acpi_device_id mxc6255_acpi_match[] = {
> +	{"MXC6225",	0},
>  	{"MXC6255",	0},
>  	{ }
>  };
>  MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
>  
>  static const struct i2c_device_id mxc6255_id[] = {
> +	{"mxc6225",	0},
>  	{"mxc6255",	0},
>  	{ }
>  };
> 


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

* Re: [PATCH] iio: accel: mxc6255 add support for the mxc6225
  2016-09-05 20:19 ` Jonathan Cameron
@ 2016-09-06  7:44   ` Hans de Goede
  2016-09-06  7:46     ` jic23
  0 siblings, 1 reply; 4+ messages in thread
From: Hans de Goede @ 2016-09-06  7:44 UTC (permalink / raw
  To: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Teodora Baluta
  Cc: linux-iio

Hi,

On 05-09-16 22:19, Jonathan Cameron wrote:
> On 04/09/16 18:35, Hans de Goede wrote:
>> The mxc6225 is fully compatible with the existing mxc6255 driver,
>> add support for it.
>>
>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> Ah well. Can't find any docs on this on via google so I'll take
> your word for it :)

I don't have docs either, but the android driver uses the same
registers and in the same way as the existing mxc6255 driver;
and I've also confirmed that this works on actual hardware.

Should I put something to this extend in the commit msg next
time ?

Regards,

Hans


>
> Applied to the togreg branch of iio.git and pushed out as testing
> for the autobuilders to play with it.
>
> Thanks,
>
> Jonathan
>> ---
>>  drivers/iio/accel/mxc6255.c | 9 ++++++++-
>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/iio/accel/mxc6255.c b/drivers/iio/accel/mxc6255.c
>> index 97ccde7..50343a7 100644
>> --- a/drivers/iio/accel/mxc6255.c
>> +++ b/drivers/iio/accel/mxc6255.c
>> @@ -26,6 +26,7 @@
>>  #define MXC6255_REG_YOUT		0x01
>>  #define MXC6255_REG_CHIP_ID		0x08
>>
>> +#define MXC6225_CHIP_ID			0xe5
>>  #define MXC6255_CHIP_ID			0x05
>>
>>  /*
>> @@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client *client,
>>  		return ret;
>>  	}
>>
>> -	if (chip_id != MXC6255_CHIP_ID) {
>> +	switch (chip_id) {
>> +	case MXC6225_CHIP_ID:
>> +	case MXC6255_CHIP_ID:
>> +		break;
>> +	default:
>>  		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
>>  		return -ENODEV;
>>  	}
>> @@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client *client,
>>  }
>>
>>  static const struct acpi_device_id mxc6255_acpi_match[] = {
>> +	{"MXC6225",	0},
>>  	{"MXC6255",	0},
>>  	{ }
>>  };
>>  MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
>>
>>  static const struct i2c_device_id mxc6255_id[] = {
>> +	{"mxc6225",	0},
>>  	{"mxc6255",	0},
>>  	{ }
>>  };
>>
>

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

* Re: [PATCH] iio: accel: mxc6255 add support for the mxc6225
  2016-09-06  7:44   ` Hans de Goede
@ 2016-09-06  7:46     ` jic23
  0 siblings, 0 replies; 4+ messages in thread
From: jic23 @ 2016-09-06  7:46 UTC (permalink / raw
  To: Hans de Goede
  Cc: Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Teodora Baluta, linux-iio

On 06.09.2016 08:44, Hans de Goede wrote:
> Hi,
> 
> On 05-09-16 22:19, Jonathan Cameron wrote:
>> On 04/09/16 18:35, Hans de Goede wrote:
>>> The mxc6225 is fully compatible with the existing mxc6255 driver,
>>> add support for it.
>>> 
>>> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
>> Ah well. Can't find any docs on this on via google so I'll take
>> your word for it :)
> 
> I don't have docs either, but the android driver uses the same
> registers and in the same way as the existing mxc6255 driver;
> and I've also confirmed that this works on actual hardware.
> 
> Should I put something to this extend in the commit msg next
> time ?
Info like this is always helpful. So please do.
> 
> Regards,
> 
> Hans
> 
> 
>> 
>> Applied to the togreg branch of iio.git and pushed out as testing
>> for the autobuilders to play with it.
>> 
>> Thanks,
>> 
>> Jonathan
>>> ---
>>>  drivers/iio/accel/mxc6255.c | 9 ++++++++-
>>>  1 file changed, 8 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/drivers/iio/accel/mxc6255.c 
>>> b/drivers/iio/accel/mxc6255.c
>>> index 97ccde7..50343a7 100644
>>> --- a/drivers/iio/accel/mxc6255.c
>>> +++ b/drivers/iio/accel/mxc6255.c
>>> @@ -26,6 +26,7 @@
>>>  #define MXC6255_REG_YOUT		0x01
>>>  #define MXC6255_REG_CHIP_ID		0x08
>>> 
>>> +#define MXC6225_CHIP_ID			0xe5
>>>  #define MXC6255_CHIP_ID			0x05
>>> 
>>>  /*
>>> @@ -154,7 +155,11 @@ static int mxc6255_probe(struct i2c_client 
>>> *client,
>>>  		return ret;
>>>  	}
>>> 
>>> -	if (chip_id != MXC6255_CHIP_ID) {
>>> +	switch (chip_id) {
>>> +	case MXC6225_CHIP_ID:
>>> +	case MXC6255_CHIP_ID:
>>> +		break;
>>> +	default:
>>>  		dev_err(&client->dev, "Invalid chip id %x\n", chip_id);
>>>  		return -ENODEV;
>>>  	}
>>> @@ -171,12 +176,14 @@ static int mxc6255_probe(struct i2c_client 
>>> *client,
>>>  }
>>> 
>>>  static const struct acpi_device_id mxc6255_acpi_match[] = {
>>> +	{"MXC6225",	0},
>>>  	{"MXC6255",	0},
>>>  	{ }
>>>  };
>>>  MODULE_DEVICE_TABLE(acpi, mxc6255_acpi_match);
>>> 
>>>  static const struct i2c_device_id mxc6255_id[] = {
>>> +	{"mxc6225",	0},
>>>  	{"mxc6255",	0},
>>>  	{ }
>>>  };
>>> 
>> 

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

end of thread, other threads:[~2016-09-06  7:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-04 17:35 [PATCH] iio: accel: mxc6255 add support for the mxc6225 Hans de Goede
2016-09-05 20:19 ` Jonathan Cameron
2016-09-06  7:44   ` Hans de Goede
2016-09-06  7:46     ` jic23

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.