Thread (38 messages) 38 messages, 8 authors, 2022-07-21

Re: [PATCH v5 09/13] iio: adc: mt6370: Add MediaTek MT6370 support

From: Andy Shevchenko <hidden>
Date: 2022-07-15 13:19:02
Also in: dri-devel, linux-arm-kernel, linux-devicetree, linux-iio, linux-leds, linux-mediatek, linux-pm, linux-usb, lkml

On Fri, Jul 15, 2022 at 1:28 PM ChiaEn Wu [off-list ref] wrote:
From: ChiaEn Wu <redacted>

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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help