Re: [PATCH 2/2] iio: pressure: mpl115: support MPL115A1

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2016-01-15 1:37 GMT+09:00 Lars-Peter Clausen <lars@xxxxxxxxxx>:
> On 01/14/2016 05:30 PM, Akinobu Mita wrote:
>> mpl115 driver currently supports i2c interface (MPL115A2).
>> There is also SPI version (MPL115A1).  The difference between them
>> is only physical transport so we can easily support both while sharing
>> most of the code.
>>
>> Signed-off-by: Akinobu Mita <akinobu.mita@xxxxxxxxx>
>> Cc: Jonathan Cameron <jic23@xxxxxxxxxx>
>> Cc: Hartmut Knaack <knaack.h@xxxxxx>
>> Cc: Lars-Peter Clausen <lars@xxxxxxxxxx>
>> Cc: Peter Meerwald <pmeerw@xxxxxxxxxx>
>> Cc: linux-iio@xxxxxxxxxxxxxxx
>> ---
>>  drivers/iio/pressure/Kconfig  |   8 +-
>>  drivers/iio/pressure/mpl115.c | 258 +++++++++++++++++++++++++++++++++++++-----
>>  2 files changed, 236 insertions(+), 30 deletions(-)
>>
>> diff --git a/drivers/iio/pressure/Kconfig b/drivers/iio/pressure/Kconfig
>> index 6f2e7c9..fa628b7 100644
>> --- a/drivers/iio/pressure/Kconfig
>> +++ b/drivers/iio/pressure/Kconfig
>> @@ -31,11 +31,11 @@ config HID_SENSOR_PRESS
>>            will be called hid-sensor-press.
>>
>>  config MPL115
>> -     tristate "Freescale MPL115A2 pressure sensor driver"
>> -     depends on I2C
>> +     tristate "Freescale MPL115A1/2 pressure sensor driver"
>> +     depends on (SPI_MASTER && I2C!=m) || I2C
>
> Hi,
>
> for combined SPI and I2C support please follow a scheme similar to that used
> by the mma7455 driver
> (http://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/iio?id=a84ef0d181d917125f1f16cffe53f84c19968969)
> and split the driver into a core support module and one module each for I2C
> and SPI support.
>
> That is a much cleaner approach and avoids issues that can happen if core
> I2C support is build as a module and core SPI support is built-in.

Thanks for your advise.  I've just finished the conversion.  It looks
good as we can continue to use module_i2c_driver() instead of
open-coding it.
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux