From patchwork Sun Jul 28 16:40:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 169959 Delivered-To: patch@linaro.org Received: by 2002:a92:512:0:0:0:0:0 with SMTP id q18csp274012ile; Sun, 28 Jul 2019 09:41:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzCE0YJx25CWRVAudJFSBt6Hv80LkOBDddsp0ZQqd1lyewRM+Ad/V7/xzI8rRiZw2VfaGT2 X-Received: by 2002:a17:90a:32c7:: with SMTP id l65mr108106512pjb.1.1564332104696; Sun, 28 Jul 2019 09:41:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564332104; cv=none; d=google.com; s=arc-20160816; b=qN4OgRQB9nu/pDN4guxjYM69QusGA5LyUC9r9glIYkofCS0eiJ4mc5U9lKI7mBIjnz c29jKFW0LeCFPJdfInogUKTr/G/XCDetHHMBcyE1AXRwOPq8Zb6RElI4lSyhtkjBAWGy gLgw5jcZu54IjSvkVYLAggIpibHjE7ih2ZF+7bAgCtkQQuhizEgW22wcJN4Knx6lwtlt jldYekY/jZbDpXJcV+ZxR7OHXYvOEOxXZlFtunW9VbBH5Qh/jhYd4GC2YE2EVt+sfNYS nBM7JjVbfn0Loi38R6Yrgq/Z2dHyr1RhY5NAEjaUHUgE+zF5HXfckyCkL/IK0jDQ+gcH a32Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=utzluryZNWCiMcKjtA37Iw3PBQRzyoAFNM/fbkOO86Q=; b=zsxafJiwPEohHEIRTft0BLyHY7U3trqW1GAx31WX25aqDbRXr4iNFUuh7Ny/W0Abbq ssN+9dpmSQIi02gMvsnkby+vHSvJjWFDl1+pnywFdx8kZFN83k/92g35/ydhoBOfN2j/ CpZlSU5JaDlF+qPyESbNmhI/+MDwkyWFNewVE81US8n8IFpvOJvWOeWnkcTlobCac9Zy WWIZDEVsnvdFjiU4kmMfkB801CFotaPQkYFgVaYhQcwVlGOrpYhNSUTsj9whubW4r7wS RRFLp8DHp/NCp9+uroNW7aOvjNM2VHhDtinJ/jfigh9vHmEoh5OIh2yy4LVo32KR4tKq hY8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=bFFofcgE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g13si27203147pgk.369.2019.07.28.09.41.43; Sun, 28 Jul 2019 09:41:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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=@nifty.com header.s=dec2015msa header.b=bFFofcgE; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726163AbfG1Qkt (ORCPT + 29 others); Sun, 28 Jul 2019 12:40:49 -0400 Received: from conuserg-09.nifty.com ([210.131.2.76]:31867 "EHLO conuserg-09.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726046AbfG1Qkt (ORCPT ); Sun, 28 Jul 2019 12:40:49 -0400 Received: from grover.flets-west.jp (softbank126026094249.bbtec.net [126.26.94.249]) (authenticated) by conuserg-09.nifty.com with ESMTP id x6SGeKji024520; Mon, 29 Jul 2019 01:40:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-09.nifty.com x6SGeKji024520 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1564332020; bh=utzluryZNWCiMcKjtA37Iw3PBQRzyoAFNM/fbkOO86Q=; h=From:To:Cc:Subject:Date:From; b=bFFofcgElFlMDh4CaXpmYURoXbjYGSbxfvB4lC9UgewikYwVnbaLlcFgAU1H16FVE DbLi8mWKXD75MpG/we2NFOWTvPs8ycQ8M+ewxaKq+NVyrx+mlyFMfCk5bAFcTr/zdg 2aZ1A6kbYYNid0ZSzKXNtYMDnT7Gde4qwruiw7nlgbl0acJOm8CvDE3YWvcSFE/ym6 0yM78PkS0rtHc5PlkLKakdtb0nyYbqc1D7TeefZCCqSzexydCeXk75qqbJ1OyDoFmB j82OMizorGi+jaeYJ5rhd/aOedeZOA2CvtC5TUwe5LjggLaakFVfXjKNCGStrmZ0af g7myGCQelVz9A== X-Nifty-SrcIP: [126.26.94.249] From: Masahiro Yamada To: Jacek Anaszewski , Pavel Machek , Dan Murphy , linux-leds@vger.kernel.org Cc: Arnd Bergmann , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH] leds: netxbig: remove legacy board-file support Date: Mon, 29 Jul 2019 01:40:15 +0900 Message-Id: <20190728164015.15405-1-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit ebc278f15759 ("ARM: mvebu: remove static LED setup for netxbig boards"), no one in upstream passes in the platform data to this driver. Squash leds-kirkwood-netxbig.h into the driver, and remove the legacy board-file support. Link: https://lkml.org/lkml/2019/7/20/83 Suggested-by: Arnd Bergmann Signed-off-by: Masahiro Yamada --- drivers/leds/Kconfig | 1 + drivers/leds/leds-netxbig.c | 70 +++++++++++++------ .../platform_data/leds-kirkwood-netxbig.h | 54 -------------- 3 files changed, 51 insertions(+), 74 deletions(-) delete mode 100644 include/linux/platform_data/leds-kirkwood-netxbig.h -- 2.17.1 diff --git a/drivers/leds/Kconfig b/drivers/leds/Kconfig index b0fdeef10bd9..80e0399b7e6d 100644 --- a/drivers/leds/Kconfig +++ b/drivers/leds/Kconfig @@ -587,6 +587,7 @@ config LEDS_NETXBIG tristate "LED support for Big Network series LEDs" depends on LEDS_CLASS depends on MACH_KIRKWOOD + depends on OF_GPIO default y help This option enables support for LEDs found on the LaCie 2Big diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c index 10497a466775..0944cb111c34 100644 --- a/drivers/leds/leds-netxbig.c +++ b/drivers/leds/leds-netxbig.c @@ -15,7 +15,48 @@ #include #include #include -#include + +struct netxbig_gpio_ext { + unsigned int *addr; + int num_addr; + unsigned int *data; + int num_data; + unsigned int enable; +}; + +enum netxbig_led_mode { + NETXBIG_LED_OFF, + NETXBIG_LED_ON, + NETXBIG_LED_SATA, + NETXBIG_LED_TIMER1, + NETXBIG_LED_TIMER2, + NETXBIG_LED_MODE_NUM, +}; + +#define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM + +struct netxbig_led_timer { + unsigned long delay_on; + unsigned long delay_off; + enum netxbig_led_mode mode; +}; + +struct netxbig_led { + const char *name; + const char *default_trigger; + int mode_addr; + int *mode_val; + int bright_addr; + int bright_max; +}; + +struct netxbig_led_platform_data { + struct netxbig_gpio_ext *gpio_ext; + struct netxbig_led_timer *timer; + int num_timer; + struct netxbig_led *leds; + int num_leds; +}; /* * GPIO extension bus. @@ -306,7 +347,6 @@ static int create_netxbig_led(struct platform_device *pdev, return devm_led_classdev_register(&pdev->dev, &led_dat->cdev); } -#ifdef CONFIG_OF_GPIO static int gpio_ext_get_of_pdata(struct device *dev, struct device_node *np, struct netxbig_gpio_ext *gpio_ext) { @@ -522,30 +562,20 @@ static const struct of_device_id of_netxbig_leds_match[] = { {}, }; MODULE_DEVICE_TABLE(of, of_netxbig_leds_match); -#else -static inline int -netxbig_leds_get_of_pdata(struct device *dev, - struct netxbig_led_platform_data *pdata) -{ - return -ENODEV; -} -#endif /* CONFIG_OF_GPIO */ static int netxbig_led_probe(struct platform_device *pdev) { - struct netxbig_led_platform_data *pdata = dev_get_platdata(&pdev->dev); + struct netxbig_led_platform_data *pdata; struct netxbig_led_data *leds_data; int i; int ret; - if (!pdata) { - pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) - return -ENOMEM; - ret = netxbig_leds_get_of_pdata(&pdev->dev, pdata); - if (ret) - return ret; - } + pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); + if (!pdata) + return -ENOMEM; + ret = netxbig_leds_get_of_pdata(&pdev->dev, pdata); + if (ret) + return ret; leds_data = devm_kcalloc(&pdev->dev, pdata->num_leds, sizeof(*leds_data), @@ -571,7 +601,7 @@ static struct platform_driver netxbig_led_driver = { .probe = netxbig_led_probe, .driver = { .name = "leds-netxbig", - .of_match_table = of_match_ptr(of_netxbig_leds_match), + .of_match_table = of_netxbig_leds_match, }, }; diff --git a/include/linux/platform_data/leds-kirkwood-netxbig.h b/include/linux/platform_data/leds-kirkwood-netxbig.h deleted file mode 100644 index 3c85a735c380..000000000000 --- a/include/linux/platform_data/leds-kirkwood-netxbig.h +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Platform data structure for netxbig LED driver - * - * This file is licensed under the terms of the GNU General Public - * License version 2. This program is licensed "as is" without any - * warranty of any kind, whether express or implied. - */ - -#ifndef __LEDS_KIRKWOOD_NETXBIG_H -#define __LEDS_KIRKWOOD_NETXBIG_H - -struct netxbig_gpio_ext { - unsigned *addr; - int num_addr; - unsigned *data; - int num_data; - unsigned enable; -}; - -enum netxbig_led_mode { - NETXBIG_LED_OFF, - NETXBIG_LED_ON, - NETXBIG_LED_SATA, - NETXBIG_LED_TIMER1, - NETXBIG_LED_TIMER2, - NETXBIG_LED_MODE_NUM, -}; - -#define NETXBIG_LED_INVALID_MODE NETXBIG_LED_MODE_NUM - -struct netxbig_led_timer { - unsigned long delay_on; - unsigned long delay_off; - enum netxbig_led_mode mode; -}; - -struct netxbig_led { - const char *name; - const char *default_trigger; - int mode_addr; - int *mode_val; - int bright_addr; - int bright_max; -}; - -struct netxbig_led_platform_data { - struct netxbig_gpio_ext *gpio_ext; - struct netxbig_led_timer *timer; - int num_timer; - struct netxbig_led *leds; - int num_leds; -}; - -#endif /* __LEDS_KIRKWOOD_NETXBIG_H */