lkml.org 
[lkml]   [2022]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support
On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu <peterwu.pub@gmail.com> wrote:
>
> From: ChiaEn Wu <chiaen_wu@richtek.com>
>
> MediaTek MT6370 is a SubPMIC consisting of a single cell battery charger
> with ADC monitoring, RGB LEDs, dual channel flashlight, WLED backlight
> driver, display bias voltage supply, one general purpose LDO, and the
> USB Type-C & PD controller complies with the latest USB Type-C and PD
> standards.
>
> This adds support the MT6370 ADC driver for system monitoring, including

This adds --> Add a

> charger current, voltage, and temperature.

...

> +#include <linux/bits.h>
> +#include <linux/bitfield.h>
> +#include <linux/iio/iio.h>
> +#include <linux/kernel.h>
> +#include <linux/mod_devicetable.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/sysfs.h>

...

> +#define MT6370_AICR_400MA 0x6
> +#define MT6370_ICHG_500MA 0x4
> +#define MT6370_ICHG_900MA 0x8

_mA ?

...

> + ret = regmap_read_poll_timeout(priv->regmap,
> + MT6370_REG_CHG_ADC, reg_val,
> + !(reg_val & MT6370_ADC_START_MASK),
> + ADC_CONV_POLLING_TIME_US,
> + ADC_CONV_TIME_MS * 1000 * 3);

1000 --> MILLI ?

...

> +static int mt6370_adc_probe(struct platform_device *pdev)
> +{

Given comment in one place in the entire series would be good to use
in another where appropriate. For example, here it would also be nice
to have a temporary variable

struct device *dev = &pdev->dev;

It will shorten some lines.

> + struct mt6370_adc_data *priv;
> + struct iio_dev *indio_dev;
> + struct regmap *regmap;
> + int ret;

> +}

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-07-15 15:19    [W:0.176 / U:0.312 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site