From patchwork Wed Nov 15 19:52:12 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 118997 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3899643edl; Wed, 15 Nov 2017 11:52:47 -0800 (PST) X-Google-Smtp-Source: AGs4zMZHude4ttCIyDTjCf5nAEJe+fETsAlpu2x6kLm14wSbC8zI40G5a3jNTx8QVAy4xXPEo6eQ X-Received: by 10.101.91.137 with SMTP id i9mr11454657pgr.313.1510775567289; Wed, 15 Nov 2017 11:52:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510775567; cv=none; d=google.com; s=arc-20160816; b=qvfu2oHjxX7z2FEaRJyJ5Xu8dVyG/N/A1d1Nb7PKHWWqxy+AhtFKf3jRvTkdHW9aO6 VkQ/M1gnM14N7LqLmfv9WElNgexTs254NPdl/6UXz5cw60rCoWdCcVnkYttgYCC471m/ OjU1Q9l7nM5lrBY8OifmyL4dOH/rJcTexe+z6q4e5sDxxwMBsNtlOOsGpvwsHdZ1+m4N GH/29NOMMakovPxHJcdHgIe6FvnvyrhPbJCzvtChEYt2Y3/oO9YHkjgioqI8x4+k8Dbw Meglbhl8Nyoal4/uESBQJ4tKli4BN8OcSHfbDfBKi3xpUpZywXGgFLxHcOUP7g1fUdYt Q7Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=lav1g3UpTLZ+/fX9sahynYlFuf1eLK2YoEDFdaZbSmY=; b=syhtQwUFrntLCstXHDbSbVGRHJoorlbu7lapHeXndHS8563wrGBUgE5+P+lE331FVx MkwV/ln/m3q8YKNn8C+2VTpF7qbLp0PPZbvStEtOMetYYy+uyR8d40V37eutowq7suro W49R0EewvjL/v7E0iQIWdr7VCaxXbATMi9j1pf07eJKkKQM2ZS1NKrmA2nlSQuzrf4mv BuZkIwHgxL+2S/PKHHFb6RyFy5Qy/BO+D8J6n++uOWeuA17QswO4kyXXCxiT6G3yzdZk SE73L0cdSdi11CHyK4xtGdZmajTN8/aiGmeZXjYZsHFhUxme79hcaiyxFjS1FCgiZ9rd OF1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dvzPxfeA; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8si17793448plb.717.2017.11.15.11.52.47 for ; Wed, 15 Nov 2017 11:52:47 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=dvzPxfeA; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757555AbdKOTwq (ORCPT ); Wed, 15 Nov 2017 14:52:46 -0500 Received: from lelnx193.ext.ti.com ([198.47.27.77]:20165 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754905AbdKOTwq (ORCPT ); Wed, 15 Nov 2017 14:52:46 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id vAFJqYqp014153; Wed, 15 Nov 2017 13:52:34 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1510775554; bh=ye79QrZwug4Czz6ys8ZqfQNpBZDTU8gxq5vWaMO2jS0=; h=From:To:CC:Subject:Date; b=dvzPxfeAT/yiyMddqnWrkYYsGnt52eR7Y+mvpIb7CdkG0EhFcO+vCt52Uy0L0hIyN 7k6Qqo2T8E5gb3apvMA2gwzraZ2DzotMjmg8vAoGrPVRrpEP6KVyPrQsE2vnkiYtzX u13VkD1I5WA3ecM+GHp9XQuGG0p+VIDGAGQzrByo= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id vAFJqYi9000540; Wed, 15 Nov 2017 13:52:34 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Wed, 15 Nov 2017 13:52:34 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Wed, 15 Nov 2017 13:52:34 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vAFJqYZN018392; Wed, 15 Nov 2017 13:52:34 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.167.247]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vAFJqY300937; Wed, 15 Nov 2017 13:52:34 -0600 (CST) From: Dan Murphy To: , , CC: , , Dan Murphy Subject: [PATCH 1/2] leds: lp8860: Fix linuxdoc format for structure Date: Wed, 15 Nov 2017 13:52:12 -0600 Message-ID: <20171115195213.8404-1-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Fix the linuxdoc format defining the lp8860 structure. Signed-off-by: Dan Murphy --- drivers/leds/leds-lp8860.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 3e70775a2d54..91b6c5fbd361 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -98,7 +98,7 @@ * @enable_gpio - VDDIO/EN gpio to enable communication interface * @regulator - LED supply regulator pointer * @label - LED label -**/ + */ struct lp8860_led { struct mutex lock; struct i2c_client *client; From patchwork Wed Nov 15 19:52:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Murphy X-Patchwork-Id: 118998 Delivered-To: patch@linaro.org Received: by 10.80.225.132 with SMTP id k4csp3899696edl; Wed, 15 Nov 2017 11:52:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMYWD7fgdGebveDYVJeORHD6As/QSzn4USVNnWeb2rFmx06YQa5mj8iAw6ytJxr02v8LcRR2 X-Received: by 10.98.214.21 with SMTP id r21mr16187128pfg.74.1510775570321; Wed, 15 Nov 2017 11:52:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510775570; cv=none; d=google.com; s=arc-20160816; b=Pq7HnPp+ihgEr2e8PnKBj0kw8GYDGSoCuJJZvJbqLIiDIAcJfOHIJUle403qkDQAXY MEWmDIg/AgmxUEZVyiWGMw9/+Uqk0qeeib56dO0eo+2bIILowew7g1puodEGcDKNxB+o 9COGpB/IEeFwea6Yr3e2sf4oCHlBWmcoMTGVbbQTO+GrfQXaCAOUWABla5uRei4+RWSj 2IcqcpqAxieUKNfHkShzGLWriU5rTkdxMVJWsYQgfuCKwIySy5zWM89mg4QFk1lyQfvk N2CAScoAkvvPBzYihNLR4m0vEOe02AZzne9VjJaI9TB26ZUIIePUFkFbFkR8RA40RoXL qKEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=c4QluAXcGQbz26sdJZUMKC1ccSqR799T5IOE8hGogu8=; b=sqsdz733xRVTaGxN2hxoDJ39Qwu+s3i2ZpDvvjIS4MG9mgdke25K7iqimxQ0zQR3qk jB05i3eo4AwdnrMlbDGY9dZ3u/1dWHRmc/f2rKtIn4jInarmrpCFRM/e83HZOzTisOmE sVphIXtilipNbMuIm6TUcc62b2SVSm2yfz/XcWwegvWaF2iavT9YMGJMffVDe2NJDB/P MB1DLK9IYTaPUu9IG9g2BktmErpW5Svu+sxeRiQluS/M7LNQG8FXdsX9nKo529Q7dT17 vt97/4FZWfQBPZuipd0Njs0AQntCGzFNCcva6ZU+4ZANLDtrHzc4jfL0m/2rAZAdWFWb tqyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kn188+29; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id az8si17793448plb.717.2017.11.15.11.52.50 for ; Wed, 15 Nov 2017 11:52:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=kn188+29; spf=pass (google.com: best guess record for domain of linux-leds-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-leds-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758887AbdKOTwt (ORCPT ); Wed, 15 Nov 2017 14:52:49 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:58574 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755666AbdKOTwq (ORCPT ); Wed, 15 Nov 2017 14:52:46 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id vAFJqZ9V023554; Wed, 15 Nov 2017 13:52:35 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1510775555; bh=wJJlWKITVCsvLGrA/HwBTWwBAmLFAomy/KeuAnYJQvw=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=kn188+29Sweg1DDhWUrw70RGqRPw+xkJ8X5Ox+Fbm/goHBbxhvWP9kZ0Gz+qGFiYC tR90a0O2V2k84MzoJdIP+x+EmIQQV7lfUlvaugOXF+NUNLqIFuUV4deGtVDZF8/dTm TgaKdWhLcxN0aNRJtGYYOJUbNbf+oQTVSBEX85UM= Received: from DFLE111.ent.ti.com (dfle111.ent.ti.com [10.64.6.32]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id vAFJqZrm023833; Wed, 15 Nov 2017 13:52:35 -0600 Received: from DFLE104.ent.ti.com (10.64.6.25) by DFLE111.ent.ti.com (10.64.6.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Wed, 15 Nov 2017 13:52:34 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Wed, 15 Nov 2017 13:52:34 -0600 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vAFJqYHY018400; Wed, 15 Nov 2017 13:52:34 -0600 Received: from localhost (a0272616local-lt.dhcp.ti.com [172.22.167.247]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id vAFJqY300941; Wed, 15 Nov 2017 13:52:34 -0600 (CST) From: Dan Murphy To: , , CC: , , Dan Murphy Subject: [PATCH 2/2] leds: lp8860: Add regulator enable during init Date: Wed, 15 Nov 2017 13:52:13 -0600 Message-ID: <20171115195213.8404-2-dmurphy@ti.com> X-Mailer: git-send-email 2.12.2 In-Reply-To: <20171115195213.8404-1-dmurphy@ti.com> References: <20171115195213.8404-1-dmurphy@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Add the regulator enable call during initialization. If init fails then disable the regulator. Also during init the gpio gets set low even on a passing case so add if everything passes then return. Signed-off-by: Dan Murphy --- drivers/leds/leds-lp8860.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) -- 2.15.0.124.g7668cbc60 diff --git a/drivers/leds/leds-lp8860.c b/drivers/leds/leds-lp8860.c index 91b6c5fbd361..f91a4fe25168 100644 --- a/drivers/leds/leds-lp8860.c +++ b/drivers/leds/leds-lp8860.c @@ -247,6 +247,15 @@ static int lp8860_init(struct lp8860_led *led) unsigned int read_buf; int ret, i, reg_count; + if (led->regulator) { + ret = regulator_enable(led->regulator); + if (ret) { + dev_err(&led->client->dev, + "Failed to enable regulator\n"); + return ret; + } + } + if (led->enable_gpio) gpiod_direction_output(led->enable_gpio, 1); @@ -282,12 +291,25 @@ static int lp8860_init(struct lp8860_led *led) ret = regmap_write(led->regmap, LP8860_EEPROM_CNTRL, LP8860_PROGRAM_EEPROM); - if (ret) + if (ret) { dev_err(&led->client->dev, "Failed programming EEPROM\n"); + goto out; + } + + return ret; + out: if (ret) if (led->enable_gpio) gpiod_direction_output(led->enable_gpio, 0); + + if (led->regulator) { + ret = regulator_disable(led->regulator); + if (ret) + dev_err(&led->client->dev, + "Failed to disable regulator\n"); + } + return ret; }