{"id":816671,"url":"http://patchwork.ozlabs.org/api/patches/816671/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/patch/20170921060704.19153-3-anarsoul@gmail.com/","project":{"id":18,"url":"http://patchwork.ozlabs.org/api/projects/18/?format=json","name":"U-Boot","link_name":"uboot","list_id":"u-boot.lists.denx.de","list_email":"u-boot@lists.denx.de","web_url":null,"scm_url":null,"webscm_url":null,"list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20170921060704.19153-3-anarsoul@gmail.com>","list_archive_url":null,"date":"2017-09-21T06:07:03","name":"[U-Boot,v2,2/3] video: pwm_backlight: make regulator optional","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"2c9301fee1c58de1e35232bfd767aeb2395b1a38","submitter":{"id":6930,"url":"http://patchwork.ozlabs.org/api/people/6930/?format=json","name":"Vasily Khoruzhick","email":"anarsoul@gmail.com"},"delegate":{"id":17739,"url":"http://patchwork.ozlabs.org/api/users/17739/?format=json","username":"jagan","first_name":"Jagannadha Sutradharudu","last_name":"Teki","email":"jagannadh.teki@gmail.com"},"mbox":"http://patchwork.ozlabs.org/project/uboot/patch/20170921060704.19153-3-anarsoul@gmail.com/mbox/","series":[{"id":4301,"url":"http://patchwork.ozlabs.org/api/series/4301/?format=json","web_url":"http://patchwork.ozlabs.org/project/uboot/list/?series=4301","date":"2017-09-21T06:07:01","name":"sunxi: add PWM driver for H3 and A64","version":3,"mbox":"http://patchwork.ozlabs.org/series/4301/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/816671/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/816671/checks/","tags":{},"related":[],"headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"rjkGZG8b\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyR5D2Vgmz9sP1\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 21 Sep 2017 16:09:04 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 130ACC21F28; Thu, 21 Sep 2017 06:08:11 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 517ABC21F26;\n\tThu, 21 Sep 2017 06:07:29 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid A967BC21F39; Thu, 21 Sep 2017 06:07:21 +0000 (UTC)","from mail-pf0-f193.google.com (mail-pf0-f193.google.com\n\t[209.85.192.193])\n\tby lists.denx.de (Postfix) with ESMTPS id 85F65C21C93\n\tfor <u-boot@lists.denx.de>; Thu, 21 Sep 2017 06:07:17 +0000 (UTC)","by mail-pf0-f193.google.com with SMTP id i23so2105467pfi.2\n\tfor <u-boot@lists.denx.de>; Wed, 20 Sep 2017 23:07:17 -0700 (PDT)","from anarsoul-thinkpad.lan (216-71-193-140.dyn.novuscom.net.\n\t[216.71.193.140]) by smtp.gmail.com with ESMTPSA id\n\tc82sm1172404pfe.172.2017.09.20.23.07.14\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\n\tWed, 20 Sep 2017 23:07:15 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=BBLe8h7nVV7EECrhyk5iNhlNeYbVPTs3/vhCg2GLym8=;\n\tb=rjkGZG8bVfALLrkWobvJtrOsliwbNriHUF0qPs+YlLL0ZyhzEg4IdeRFWKYExEesob\n\tgcV9jkBtRhUHMxkdML9/oXWt/k1NW066lmGEB4e2A34Dr6nSV3cpiM6ebnxNYwtP3rkh\n\t41tOrICeXK/fdK7ezWceeATTwYlcnhKvQp9hni61y3FHfTsFatffwhKy++GQXPkJbefJ\n\th2GdHrJIQ3nhYsYR/C7MGqGPYBH8ckxtzujH7dMjeSuXICuqeF9W0Rr5btvAlZz5I+CC\n\td8lhGwIBKIw38FY23Sy0s8AuG8UKbqdCMWr8uIGo9A26SOhJBiMWHeuwBEeQdZWiM7ju\n\tc5ng==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=BBLe8h7nVV7EECrhyk5iNhlNeYbVPTs3/vhCg2GLym8=;\n\tb=lRtZ6u5WOz+uxJEN8o9L4Pf9+gKcp1M+2UzEnF09OtJ5x7MWL/0Ut3VmUf0FZu1p7U\n\t6qtUEtSqcrW0qKSpqFf8KHkgMWqIGqfnQL/p94UgDQ5LqKl+6qo9je46ZmswmHW7g0sf\n\tSbJJUzinCkkuE3gFhhBQMPSy35qa9P0vxWbaAdmcPOQhSPq7lt2mEc5/jMCV70ycVckx\n\t46AAgTcpychhdgnQQyRyUf9t4tPKHDBySnq4wC7XJHexl/STcP5DTbYlZZXBsw748xDx\n\t/qoUdBWy3420BIyQkSGhjZtG2UDAUnqIpSXCg6xN5mAtn3MacysOau0Bn+FTg/+Bum3t\n\t9FTQ==","X-Gm-Message-State":"AHPjjUgRvlIr8QvZPrnAh0gnw3u/d5dXTwZtLVS4kUjD68NDkICxRmhI\n\tiCmdm0Ukm9g8cck8PpybGWg=","X-Google-Smtp-Source":"AOwi7QBULJMGJB0HOJV2jz0ZwPMwntdbcestxaNV+SL+g4bTV3BrRA3XBS3akzzct/Rj+GQ3qhr1qw==","X-Received":"by 10.98.73.2 with SMTP id w2mr4604467pfa.133.1505974035928;\n\tWed, 20 Sep 2017 23:07:15 -0700 (PDT)","From":"Vasily Khoruzhick <anarsoul@gmail.com>","To":"Jagan Teki <jagan@openedev.com>,\n\tMaxime Ripard <maxime.ripard@free-electrons.com>,\n\tAnatolij Gustschin <agust@denx.de>,\n\tAndre Przywara <andre.przywara@arm.com>, u-boot@lists.denx.de,\n\ticenowy@aosc.io","Date":"Wed, 20 Sep 2017 23:07:03 -0700","Message-Id":"<20170921060704.19153-3-anarsoul@gmail.com>","X-Mailer":"git-send-email 2.14.1","In-Reply-To":"<20170921060704.19153-1-anarsoul@gmail.com>","References":"<20170921060704.19153-1-anarsoul@gmail.com>","Subject":"[U-Boot] [PATCH v2 2/3] video: pwm_backlight: make regulator\n\toptional","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"},"content":"u-boot doesn't have dummy regulators, so pwm_backlight probe\nwill fail if regulator is missing. Make it optional to get this\ndriver working on platforms where there's no backlight regultor.\n\nSigned-off-by: Vasily Khoruzhick <anarsoul@gmail.com>\n---\nv2: - no changes\n\n drivers/video/pwm_backlight.c | 28 ++++++++++++++++------------\n 1 file changed, 16 insertions(+), 12 deletions(-)","diff":"diff --git a/drivers/video/pwm_backlight.c b/drivers/video/pwm_backlight.c\nindex fbd7bf7838..05e56ffead 100644\n--- a/drivers/video/pwm_backlight.c\n+++ b/drivers/video/pwm_backlight.c\n@@ -32,16 +32,21 @@ static int pwm_backlight_enable(struct udevice *dev)\n \tuint duty_cycle;\n \tint ret;\n \n-\tplat = dev_get_uclass_platdata(priv->reg);\n-\tdebug(\"%s: Enable '%s', regulator '%s'/'%s'\\n\", __func__, dev->name,\n-\t      priv->reg->name, plat->name);\n-\tret = regulator_set_enable(priv->reg, true);\n-\tif (ret) {\n-\t\tdebug(\"%s: Cannot enable regulator for PWM '%s'\\n\", __func__,\n-\t\t      dev->name);\n-\t\treturn ret;\n+\tif (priv->reg) {\n+\t\tplat = dev_get_uclass_platdata(priv->reg);\n+\t\tdebug(\"%s: Enable '%s', regulator '%s'/'%s'\\n\", __func__, dev->name,\n+\t\t      priv->reg->name, plat->name);\n+\t\tret = regulator_set_enable(priv->reg, true);\n+\t\tif (ret) {\n+\t\t\tdebug(\"%s: Cannot enable regulator for PWM '%s'\\n\", __func__,\n+\t\t\t      dev->name);\n+\t\t\treturn ret;\n+\t\t}\n+\t\tmdelay(120);\n \t}\n-\tmdelay(120);\n+\n+\tdebug(\"%s: default: %d, min: %d, max: %d\\n\", __func__,\n+\t\tpriv->default_level, priv->min_level, priv->max_level);\n \n \tduty_cycle = priv->period_ns * (priv->default_level - priv->min_level) /\n \t\t(priv->max_level - priv->min_level + 1);\n@@ -68,10 +73,9 @@ static int pwm_backlight_ofdata_to_platdata(struct udevice *dev)\n \tdebug(\"%s: start\\n\", __func__);\n \tret = uclass_get_device_by_phandle(UCLASS_REGULATOR, dev,\n \t\t\t\t\t   \"power-supply\", &priv->reg);\n-\tif (ret) {\n+\tif (ret)\n \t\tdebug(\"%s: Cannot get power supply: ret=%d\\n\", __func__, ret);\n-\t\treturn ret;\n-\t}\n+\n \tret = gpio_request_by_name(dev, \"enable-gpios\", 0, &priv->enable,\n \t\t\t\t   GPIOD_IS_OUT);\n \tif (ret) {\n","prefixes":["U-Boot","v2","2/3"]}