2021-10-06 16:41:28

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH 1/4] dt-bindings: vendor-prefixes: Document liteon vendor prefix

Add vendor prefix for LITE-ON Technology Corp.

Signed-off-by: Nikita Travkin <[email protected]>
---
Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
1 file changed, 2 insertions(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
index 1d77f151555b..477a5cba16fe 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
+++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
@@ -659,6 +659,8 @@ patternProperties:
description: Linux-specific binding
"^linx,.*":
description: Linx Technologies
+ "^liteon,.*":
+ description: LITE-ON Technology Corp.
"^litex,.*":
description: LiteX SoC builder
"^lltc,.*":
--
2.30.2


2021-10-06 16:43:25

by Nikita Travkin

[permalink] [raw]
Subject: [PATCH 3/4] iio: light: ltr501: Add rudimentary regulator support

On some platforms the supply regulators must be enabled before the
sensor can work. Add vdd and vddio regulators for the sensor and IO bus
power respectively.

Signed-off-by: Nikita Travkin <[email protected]>
---
drivers/iio/light/ltr501.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)

diff --git a/drivers/iio/light/ltr501.c b/drivers/iio/light/ltr501.c
index 1830221da48d..57851c8ef1c6 100644
--- a/drivers/iio/light/ltr501.c
+++ b/drivers/iio/light/ltr501.c
@@ -15,6 +15,7 @@
#include <linux/delay.h>
#include <linux/regmap.h>
#include <linux/acpi.h>
+#include <linux/regulator/consumer.h>

#include <linux/iio/iio.h>
#include <linux/iio/events.h>
@@ -151,6 +152,7 @@ struct ltr501_chip_info {

struct ltr501_data {
struct i2c_client *client;
+ struct regulator_bulk_data regulators[2];
struct mutex lock_als, lock_ps;
const struct ltr501_chip_info *chip_info;
u8 als_contr, ps_contr;
@@ -1379,6 +1381,13 @@ static const struct regmap_config ltr501_regmap_config = {
.volatile_reg = ltr501_is_volatile_reg,
};

+static void ltr501_disable_regulators(void *d)
+{
+ struct ltr501_data *data = d;
+
+ regulator_bulk_disable(ARRAY_SIZE(data->regulators), data->regulators);
+}
+
static int ltr501_powerdown(struct ltr501_data *data)
{
return ltr501_write_contr(data, data->als_contr &
@@ -1423,6 +1432,25 @@ static int ltr501_probe(struct i2c_client *client,
mutex_init(&data->lock_als);
mutex_init(&data->lock_ps);

+ data->regulators[0].supply = "vdd";
+ data->regulators[1].supply = "vddio";
+ ret = devm_regulator_bulk_get(&client->dev,
+ ARRAY_SIZE(data->regulators),
+ data->regulators);
+ if (ret)
+ return dev_err_probe(&client->dev, ret,
+ "Failed to get regulators\n");
+
+ ret = regulator_bulk_enable(ARRAY_SIZE(data->regulators),
+ data->regulators);
+ if (ret)
+ return ret;
+
+ ret = devm_add_action_or_reset(&client->dev,
+ ltr501_disable_regulators, data);
+ if (ret)
+ return ret;
+
data->reg_it = devm_regmap_field_alloc(&client->dev, regmap,
reg_field_it);
if (IS_ERR(data->reg_it)) {
--
2.30.2

2021-10-07 19:39:42

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: vendor-prefixes: Document liteon vendor prefix

On Wed, 6 Oct 2021 21:30:55 +0500
Nikita Travkin <[email protected]> wrote:

> Add vendor prefix for LITE-ON Technology Corp.
>
> Signed-off-by: Nikita Travkin <[email protected]>
Series looks good to me. I'll leave some time for dt binding review though
before picking it up.

Thanks,

Jonathan

> ---
> Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> index 1d77f151555b..477a5cba16fe 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml
> @@ -659,6 +659,8 @@ patternProperties:
> description: Linux-specific binding
> "^linx,.*":
> description: Linx Technologies
> + "^liteon,.*":
> + description: LITE-ON Technology Corp.
> "^litex,.*":
> description: LiteX SoC builder
> "^lltc,.*":

2021-10-15 02:29:57

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: vendor-prefixes: Document liteon vendor prefix

On Wed, 06 Oct 2021 21:30:55 +0500, Nikita Travkin wrote:
> Add vendor prefix for LITE-ON Technology Corp.
>
> Signed-off-by: Nikita Travkin <[email protected]>
> ---
> Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
> 1 file changed, 2 insertions(+)
>

Acked-by: Rob Herring <[email protected]>

2021-10-18 03:37:30

by Jonathan Cameron

[permalink] [raw]
Subject: Re: [PATCH 1/4] dt-bindings: vendor-prefixes: Document liteon vendor prefix

On Thu, 14 Oct 2021 15:28:08 -0500
Rob Herring <[email protected]> wrote:

> On Wed, 06 Oct 2021 21:30:55 +0500, Nikita Travkin wrote:
> > Add vendor prefix for LITE-ON Technology Corp.
> >
> > Signed-off-by: Nikita Travkin <[email protected]>
> > ---
> > Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++
> > 1 file changed, 2 insertions(+)
> >
>
> Acked-by: Rob Herring <[email protected]>

Series applied to the togreg branch of iio.git which is initially pushed
out as testing for 0-day to see if it can find anything we missed.

Thanks,

Jonathan