From patchwork Sat Sep 1 08:16:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "AnilKumar, Chimata" X-Patchwork-Id: 1394891 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 1C9EF3FC85 for ; Sat, 1 Sep 2012 08:17:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752800Ab2IAIRQ (ORCPT ); Sat, 1 Sep 2012 04:17:16 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:41276 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752500Ab2IAIRO (ORCPT ); Sat, 1 Sep 2012 04:17:14 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q818GsJ4013738; Sat, 1 Sep 2012 03:16:55 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q818GoX7027999; Sat, 1 Sep 2012 13:46:50 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Sat, 1 Sep 2012 13:46:49 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q818Gipo007156; Sat, 1 Sep 2012 13:46:45 +0530 From: AnilKumar Ch To: , , CC: , , , , , AnilKumar Ch Subject: [PATCH v2] leds: leds-gpio: adopt pinctrl support Date: Sat, 1 Sep 2012 13:46:30 +0530 Message-ID: <1346487390-11399-1-git-send-email-anilkumar@ti.com> X-Mailer: git-send-email 1.7.0.4 MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Adopt pinctrl support to leds-gpio driver based on leds-gpio device pointer, pinctrl driver configure SoC pins to GPIO mode according to definitions provided in .dts file. Signed-off-by: AnilKumar Ch Reviewed-by: Linus Walleij --- Changes from v1: - Seperated from "Add DT for AM33XX devices" patch series - Incorporated Tony's comments on v1 * Changed to warning message instead od error return drivers/leds/leds-gpio.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/leds/leds-gpio.c b/drivers/leds/leds-gpio.c index c032b21..ad577f4 100644 --- a/drivers/leds/leds-gpio.c +++ b/drivers/leds/leds-gpio.c @@ -20,6 +20,7 @@ #include #include #include +#include struct gpio_led_data { struct led_classdev cdev; @@ -236,8 +237,14 @@ static int __devinit gpio_led_probe(struct platform_device *pdev) { struct gpio_led_platform_data *pdata = pdev->dev.platform_data; struct gpio_leds_priv *priv; + struct pinctrl *pinctrl; int i, ret = 0; + pinctrl = devm_pinctrl_get_select_default(&pdev->dev); + if (IS_ERR(pinctrl)) + dev_warn(&pdev->dev, + "pins are not configured from the driver\n"); + if (pdata && pdata->num_leds) { priv = devm_kzalloc(&pdev->dev, sizeof_gpio_leds_priv(pdata->num_leds),