Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1419841
| Path | csiph.com!news.freedyn.net!aioe.org!news.servidellagleba.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Stephen Barber <smbarber@chromium.org> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] backlight: lp855x: Add enable regulator |
| Date | Sat, 11 Jun 2016 02:00:01 +0200 |
| Message-ID | <rIEvf-3Sp-5@gated-at.bofh.it> (permalink) |
| References | <rIABj-Hr-15@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LgH0yehMSzY2hfELPd9Lni0UUn0zK2x3dlBW7bt+G34=; b=HV+09q5q7Ko6N91iQH9VF7Yx0n6VSsmHSEjWkXFdntuh6EnIEtwid67h1BTI312oo6 rdLbjosWaJaE7b99pWX6I8i4glelEMavbg2nTUo6aF/84X3TnmGrCajwBUYaBeBxgKNQ HQ4XsQn609WnJ9IGafy4SmxMzGXfXl3eNkL072mCl4S10Yfjjb29MBraBZF+L8A5Xr1q XyCGuc1gERaz2zmXhQwsP/EJB2ZR1qK+xpAhQdhOORQA114KTrkYrW8k8/ckBR0cV2kc 01Fy5km3kofzOuZtNN3sp4Cytf1ylj121+6hatsWCQdkpQ8cES7wiz5U0lVMWEHRmRDN CY8g== |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=LgH0yehMSzY2hfELPd9Lni0UUn0zK2x3dlBW7bt+G34=; b=be5pFN4YFNgIoOJA7876IbuhNac16ykUWNGT359PFReUEz2wOj/NxcdVAfDlPwbJ5p BTcytDXwtPTS0oIUole8+H68XNExWK25FBQ3ZrmTpGrwBEZoGq8hU8wrtRDAm8bTfZq9 dsCpe6C5V7R3I6zlbCnEEb9mztXFih9V2yaJE= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=LgH0yehMSzY2hfELPd9Lni0UUn0zK2x3dlBW7bt+G34=; b=Q5no5uqFk0ZIOm3l7kotCsrAERA731vNwzMcztez+6pN1103KD4dCEEVkd2O+eFnih 2FeMser/KEWunEyj1RibP4alu3//H7kDcKgcjCJAauZcUK91dU6amLdt8uxD5v2Ja/CY vQ/temBcAxQsqSybfGKc7H2Ba0LK2E3fhjFmmn01Tj4Q7fO2eShEUApXmGpZRQg0op7u oCZ+rVf6i2ImZjHjPLOHpEU1JMMiqG03C5p5fcNiGTGmgkJ8doKryd0gtUuIWDC7onRH 5UNYzQ7Fd9oLG36h9uacKzOb99LaCJ2AWUz/i8d8wbNmhx5dZzD/RaiwA13kUCJaZhJs cR0w== |
| X-Gm-Message-State | ALyK8tKCfH2zrr72IYZnVXLaC+oc0p7BSuxSDDenmsd5KfbeYHQyQjoTVm2PoJp+9UcBaRdnrcMfnzBJdjUrUpjo |
| X-Received | by 10.31.230.197 with SMTP id d188mr1835645vkh.143.1465602782714; Fri, 10 Jun 2016 16:53:02 -0700 (PDT) |
| MIME-Version | 1.0 |
| X-Google-Sender-Auth | M5o4dAT-EVm60_1SgScHGA4oFl4 |
| Content-Type | text/plain; charset=UTF-8 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 108 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Milo Kim <milo.kim@ti.com>, Jingoo Han <jingoohan1@gmail.com>, Lee Jones <lee.jones@linaro.org>, Doug Anderson <dianders@chromium.org>, Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>, Tomi Valkeinen <tomi.valkeinen@ti.com>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-fbdev@vger.kernel.org |
| X-Original-Date | Fri, 10 Jun 2016 16:52:43 -0700 |
| X-Original-Message-ID | <CADR9n4_XWQD3K1Kb0E-mmEM_2_oEZxx_ziC_0WFEyJ5G30VW-A@mail.gmail.com> |
| X-Original-References | <1465587597-131467-1-git-send-email-briannorris@chromium.org> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1419841 |
Show key headers only | View raw
On Fri, Jun 10, 2016 at 12:39 PM, Brian Norris <briannorris@chromium.org> wrote:
>
> The LP8556 datasheet describes an EN/VDDIO input, which serves "both as
> a chip enable and as a power supply reference for PWM, SDA, and SCL
> inputs." The LP8556 that I'm testing doesn't respond properly if I try
> to talk I2C to it too quickly after enabling VDDIO, and the LP8555
> datasheet mentions a t_RESPONSE delay of up to 1 millisecond.
>
> Support this EN/VDDIO by adding a regulator property to the binding;
> enabling this regulator at probe time; and sleeping for 1 to 2ms, if the
> EN/VDDIO regulator was provided.
>
> Signed-off-by: Brian Norris <briannorris@chromium.org>
> ---
> v2: s/TS8555/LP8555/ in comment (typo)
>
> .../devicetree/bindings/leds/backlight/lp855x.txt | 2 ++
> drivers/video/backlight/lp855x_bl.c | 29 ++++++++++++++++++++++
> 2 files changed, 31 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/leds/backlight/lp855x.txt b/Documentation/devicetree/bindings/leds/backlight/lp855x.txt
> index 0a3ecbc3a1b9..88f56641fc28 100644
> --- a/Documentation/devicetree/bindings/leds/backlight/lp855x.txt
> +++ b/Documentation/devicetree/bindings/leds/backlight/lp855x.txt
> @@ -13,6 +13,7 @@ Optional properties:
> - rom-addr: Register address of ROM area to be updated (u8)
> - rom-val: Register value to be updated (u8)
> - power-supply: Regulator which controls the 3V rail
> + - enable-supply: Regulator which controls the EN/VDDIO input
>
> Example:
>
> @@ -57,6 +58,7 @@ Example:
> backlight@2c {
> compatible = "ti,lp8557";
> reg = <0x2c>;
> + enable-supply = <&backlight_vddio>;
> power-supply = <&backlight_vdd>;
>
> dev-ctrl = /bits/ 8 <0x41>;
> diff --git a/drivers/video/backlight/lp855x_bl.c b/drivers/video/backlight/lp855x_bl.c
> index e5b14f52628f..939f057836e1 100644
> --- a/drivers/video/backlight/lp855x_bl.c
> +++ b/drivers/video/backlight/lp855x_bl.c
> @@ -13,6 +13,7 @@
> #include <linux/slab.h>
> #include <linux/i2c.h>
> #include <linux/backlight.h>
> +#include <linux/delay.h>
> #include <linux/err.h>
> #include <linux/of.h>
> #include <linux/platform_data/lp855x.h>
> @@ -74,6 +75,7 @@ struct lp855x {
> struct lp855x_platform_data *pdata;
> struct pwm_device *pwm;
> struct regulator *supply; /* regulator for VDD input */
> + struct regulator *enable; /* regulator for EN/VDDIO input */
> };
>
> static int lp855x_write_byte(struct lp855x *lp, u8 reg, u8 data)
> @@ -433,6 +435,19 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
> lp->supply = NULL;
> }
>
> + lp->enable = devm_regulator_get_optional(lp->dev, "enable");
> + if (IS_ERR(lp->enable)) {
> + ret = PTR_ERR(lp->enable);
> + if (ret == -ENODEV) {
> + lp->enable = NULL;
> + } else {
> + if (ret != -EPROBE_DEFER)
> + dev_err(lp->dev, "error getting enable regulator: %d\n",
> + ret);
> + return ret;
> + }
> + }
> +
> if (lp->supply) {
> ret = regulator_enable(lp->supply);
> if (ret < 0) {
> @@ -441,6 +456,20 @@ static int lp855x_probe(struct i2c_client *cl, const struct i2c_device_id *id)
> }
> }
>
> + if (lp->enable) {
> + ret = regulator_enable(lp->enable);
> + if (ret < 0) {
> + dev_err(lp->dev, "failed to enable vddio: %d\n", ret);
> + return ret;
> + }
> +
> + /*
> + * LP8555 datasheet says t_RESPONSE (time between VDDIO and
> + * I2C) is 1ms.
> + */
> + usleep_range(1000, 2000);
> + }
> +
> i2c_set_clientdata(cl, lp);
>
> ret = lp855x_configure(lp);
> --
> 2.8.0.rc3.226.g39d4020
>
Reviewed-by: Stephen Barber <smbarber@chromium.org>
Steve
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] backlight: lp855x: Add enable regulator Brian Norris <briannorris@chromium.org> - 2016-06-10 21:50 +0200 Re: [PATCH v2] backlight: lp855x: Add enable regulator Stephen Barber <smbarber@chromium.org> - 2016-06-11 02:00 +0200 Re: [PATCH v2] backlight: lp855x: Add enable regulator "Kim, Milo" <milo.kim@ti.com> - 2016-06-13 03:10 +0200 Re: [PATCH v2] backlight: lp855x: Add enable regulator Rob Herring <robh@kernel.org> - 2016-06-14 22:10 +0200 Re: [PATCH v2] backlight: lp855x: Add enable regulator Lee Jones <lee.jones@linaro.org> - 2016-06-15 10:40 +0200
csiph-web