All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Titinger <mtitinger@baylibre.com>
To: Peter Meerwald-Stadler <pmeerw@pmeerw.net>
Cc: jic23@kernel.org, knaack.h@gmx.de, lars@metafoo.de,
	linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors
Date: Thu, 26 Nov 2015 10:00:38 +0100	[thread overview]
Message-ID: <5656CA36.9000908@baylibre.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1511251230170.11807@pmeerw.net>

On 25/11/2015 13:20, Peter Meerwald-Stadler wrote:
>
>> in SOFTWARE buffer mode, a kthread will capture the active scan_elements
>> into a kfifo, then compute the remaining time until the next capture tick
>> and do an active wait (udelay).
>
> minor comments below

Thanks Peter! All fixed in next iteration.

M.
...

>> +config INA2XX_IIO
>> +	tristate "Texas Instruments INA2xx Power Monitors IIO driver"
>> +	depends on I2C
>> +	select REGMAP_I2C
>> +	select IIO_BUFFER
>> +	help
>> +	  Say yes here to build support for TI INA2xx familly Power Monitors.
>
> family
>
>> +
>> +	  Note that this is not the existing hwmon interface for this device.
>
> this message not very clear

removed. This was fuel to discuss the RFC.
...

>> +
>> +/*
>> + * INA2XX registers definition
>> + */
>> +/* common register definitions */
>
> comment style; do we need both?

removed one.

>> +
>> +/*Integration Time for VShunt */
>
> time
>

ok


>> +	int itb; /* Bus voltage integration time uS */
>> +	int its; /* Shunt voltage integration tim uS */
>
> time
>

ok

ge_shift)
>> +			* chip->config->bus_voltage_lsb;
>> +		*val = *uval/1000000;
>
> whitespace around / please

ok



>> +
>> +static unsigned int ina226_set_average(struct ina2xx_chip_info *chip,
>
> retval should have type int

indeed!


>> +static const int ina226_conv_time_tab[] = { 140, 204, 332, 588, 1100,
>> +					    2116, 4156, 8244};
>
> maybe whitespace before }

ok

>> +}
>> +
>> +static unsigned int ina226_set_its(struct ina2xx_chip_info *chip,
>
> retval should have type int

ok


>> +	return 0;
>> +}
>> +
>
> drop dup newline
>

ok


>> +
>> +/*Sampling Freq is a consequence of the integration times of the V channels.*/
>
> whitespace after /* and before */ please
>

ok

>> +#define INA2XX_CHAN_VOLTAGE(_index, _address) { \
>> +	.type = IIO_VOLTAGE, \
>> +	.address = _address, \
>> +	.indexed = 1, \
>> +	.channel = (_index), \
>> +	.info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | \
>> +			      BIT(IIO_CHAN_INFO_INT_TIME), \
>> +	.scan_index = (_index), \
>> +	.scan_type = { \
>> +		.sign = 'u', \
>> +		.realbits = 16, \
>> +		.storagebits = 16, \
>> +	.endianness = IIO_BE, \
>> +	} \
>> +}
>> +
>
> drop dup newline
>

ok


>> +}
>> +
>> +/* frequencies matching the cummulated integration times for vshunt and vbus */
>
> cumulated

wrong comment anyway, fixed.

>> +	 * Set current LSB to 1mA, shunt is in uOhms
>> +	 * (equation 13 in datasheet). We hardcode a Current_LSB
>> +	 * of 1.0 x10-6. The only remaining parameter is RShunt
>
> full stop

ok

>> +	mutex_destroy(&chip->state_lock);
>
> needed?

removed.

>> +
>> +	iio_device_unregister(indio_dev);
>
> not needed since devm_iio_device_register() is used

ok



  reply	other threads:[~2015-11-26  9:00 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 11:28 [PATCH 0/2] IIO version of INA2xx (followup of related RFC) Marc Titinger
2015-11-25 11:28 ` [PATCH 1/2] iio: ina2xx: add support for TI INA2xx Power Monitors Marc Titinger
2015-11-25 12:20   ` Peter Meerwald-Stadler
2015-11-26  9:00     ` Marc Titinger [this message]
2015-11-29 16:31   ` Jonathan Cameron
2015-11-29 16:31     ` [lm-sensors] " Jonathan Cameron
2015-11-29 17:38     ` Guenter Roeck
2015-11-29 17:38       ` [lm-sensors] " Guenter Roeck
2015-12-01 10:01       ` Marc Titinger
2015-12-01 10:01         ` [lm-sensors] " Marc Titinger
2015-12-01 15:02         ` Guenter Roeck
2015-12-01 15:02           ` [lm-sensors] " Guenter Roeck
2015-11-25 11:28 ` [PATCH 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the ADCs Marc Titinger
2015-11-29 16:33   ` Jonathan Cameron
2015-11-29 16:33     ` [lm-sensors] [PATCH 2/2] iio: ina2xx: provide a sysfs parameter to allow async readout of the AD 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=5656CA36.9000908@baylibre.com \
    --to=mtitinger@baylibre.com \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 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.