linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "ludovic.tancerel@maplehightech.com"
	<ludovic.tancerel@maplehightech.com>
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, William.Markezana@meas-spec.com
Subject: Re: [PATCH v3 2/6] Add tsys01 meas-spec driver support
Date: Tue, 29 Sep 2015 18:21:32 +0100	[thread overview]
Message-ID: <560AC89C.9010706@kernel.org> (raw)
In-Reply-To: <896942C8-3780-4758-920F-6FFBA2078A43@maplehightech.com>

On 29/09/15 10:36, ludovic.tancerel@maplehightech.com wrote:
> 
> Thank you for reviewing
> Please have a look at comments below,
> 
> Regards,
> Ludovic
> 
> Le 27 sept. 2015 à 18:55, Jonathan Cameron <jic23@kernel.org> a écrit :
> 
>> On 25/09/15 14:56, Ludovic Tancerel wrote:
>>> Support for TSYS01 temperature sensor
>>>
>>> Signed-off-by: Ludovic Tancerel <ludovic.tancerel@maplehightech.com>
>> This is fine as far as i am concerned, though I would like to leave it
>> on the list for a little while for others to have a chance to comment.
>>> ---
>>> drivers/iio/temperature/Kconfig  |  11 ++
>>> drivers/iio/temperature/Makefile |   1 +
>>> drivers/iio/temperature/tsys01.c | 231 +++++++++++++++++++++++++++++++++++++++
>>> 3 files changed, 243 insertions(+)
>>> create mode 100644 drivers/iio/temperature/tsys01.c
>>>
>>>
> …
> 
>>> +static int tsys01_i2c_probe(struct i2c_client *client,
>>> +			    const struct i2c_device_id *id)
>>> +{
>>> +	struct tsys01_dev *dev_data;
>>> +	struct iio_dev *indio_dev;
>>> +
>>> +	if (!i2c_check_functionality(client->adapter,
>>> +				     I2C_FUNC_SMBUS_WORD_DATA |
>>> +				     I2C_FUNC_SMBUS_WRITE_BYTE |
>>> +				     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
>>> +		dev_err(&client->dev,
>>> +			"Adapter does not support some i2c transaction\n");
>>> +		return -ENODEV;
>>> +	}
>>> +
>>> +	indio_dev = devm_iio_device_alloc(&client->dev, sizeof(*dev_data));
>>> +	if (!indio_dev)
>>> +		return -ENOMEM;
>>> +
>>> +	dev_data = iio_priv(indio_dev);
>>> +	dev_data->client = client;
>>> +	dev_data->reset = ms_sensors_i2c_reset;
>>> +	dev_data->read_prom_word = ms_sensors_i2c_read_prom_word;
>>> +	dev_data->convert_and_read = ms_sensors_i2c_convert_and_read;
>>> +
>>> +	i2c_set_clientdata(client, indio_dev);
>>> +
>> This separation into i2c probe and main probe is something one would
>> generally only introduce at the point of adding support for another bus.
>> It just adds complexity here for little gain.  If there is intent
>> to add spi support shortly then fair enough, leave it as it is.
> 
> I don’t plan on doing the SPI stuff myself,
> so if you feel I should simplify as there is no plan to do it, please let me know.
> 
> I prefer to keep it as I made this change especially to comply a
> request to have this similar to other existing meas-spec drivers
> (ms5611).
It's not something I feel strongly about so leave it as it is.

> 
>>> +	return tsys01_probe(indio_dev, &client->dev);
>>> +}
>>> +
>>> +static const struct i2c_device_id tsys01_id[] = {
>>> +	{"tsys01", 0},
>>> +	{}
>>> +};
>>> +MODULE_DEVICE_TABLE(i2c, tsys01_id);
>>> +
>>> +static struct i2c_driver tsys01_driver = {
>>> +	.probe = tsys01_i2c_probe,
>>> +	.id_table = tsys01_id,
>>> +	.driver = {
>>> +		   .name = "tsys01",
>>> +		   },
>>> +};
>>> +
>>> +module_i2c_driver(tsys01_driver);
>>> +
>>> +MODULE_DESCRIPTION("Measurement-Specialties tsys01 temperature driver");
>>> +MODULE_AUTHOR("William Markezana <william.markezana@meas-spec.com>");
>>> +MODULE_AUTHOR("Ludovic Tancerel <ludovic.tancerel@maplehightech.com>");
>>> +MODULE_LICENSE("GPL v2");
>>>
>>
>> --
>> 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
> 
> --
> 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
> 


  reply	other threads:[~2015-09-29 17:21 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-25 13:56 [PATCH v3 0/6] iio: TSYS01, TSYS02D, HTU21, MS5637, MS8607, Measurement Specialties driver developments Ludovic Tancerel
2015-09-25 13:56 ` [PATCH v3 1/6] Add meas-spec sensors common part Ludovic Tancerel
2015-09-27 16:23   ` Jonathan Cameron
2015-09-29  7:59     ` ludovic.tancerel
2015-09-29  8:03       ` ludovic.tancerel
2015-09-29 17:20         ` Jonathan Cameron
2015-09-25 13:56 ` [PATCH v3 2/6] Add tsys01 meas-spec driver support Ludovic Tancerel
2015-09-27 16:55   ` Jonathan Cameron
2015-09-29  9:36     ` ludovic.tancerel
2015-09-29 17:21       ` Jonathan Cameron [this message]
2015-09-25 13:56 ` [PATCH v3 3/6] Add tsys02d " Ludovic Tancerel
2015-09-27 17:51   ` Jonathan Cameron
2015-09-29  9:40     ` ludovic.tancerel
2015-09-25 13:56 ` [PATCH v3 4/6] Add htu21 " Ludovic Tancerel
2015-09-27 17:54   ` Jonathan Cameron
2015-09-25 13:56 ` [PATCH v3 5/6] Add ms5637 " Ludovic Tancerel
2015-09-27 17:57   ` Jonathan Cameron
2015-09-29  9:45     ` ludovic.tancerel
2015-09-25 13:56 ` [PATCH v3 6/6] Add ms8607 " Ludovic Tancerel
2015-09-27 18:00   ` Jonathan Cameron
2015-09-29 10:00     ` ludovic.tancerel
2015-09-29 17:27       ` Jonathan Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=560AC89C.9010706@kernel.org \
    --to=jic23@kernel.org \
    --cc=William.Markezana@meas-spec.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=ludovic.tancerel@maplehightech.com \
    --cc=pmeerw@pmeerw.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).