From patchwork Mon Sep 26 16:04:50 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangwook X-Patchwork-Id: 4336 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 3120723FB8 for ; Mon, 26 Sep 2011 16:04:55 +0000 (UTC) Received: from mail-fx0-f52.google.com (mail-fx0-f52.google.com [209.85.161.52]) by fiordland.canonical.com (Postfix) with ESMTP id 16DA7A180F4 for ; Mon, 26 Sep 2011 16:04:55 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so8539576fxe.11 for ; Mon, 26 Sep 2011 09:04:55 -0700 (PDT) Received: by 10.223.5.76 with SMTP id 12mr10686099fau.103.1317053094505; Mon, 26 Sep 2011 09:04:54 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.152.3.234 with SMTP id f10cs42659laf; Mon, 26 Sep 2011 09:04:53 -0700 (PDT) Received: by 10.100.213.16 with SMTP id l16mr5975726ang.72.1317053092683; Mon, 26 Sep 2011 09:04:52 -0700 (PDT) Received: from mail-yx0-f178.google.com (mail-yx0-f178.google.com [209.85.213.178]) by mx.google.com with ESMTPS id t33si8354512ann.40.2011.09.26.09.04.51 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 09:04:52 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) client-ip=209.85.213.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.213.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) smtp.mail=sangwook.lee@linaro.org Received: by yxj19 with SMTP id 19so6276094yxj.37 for ; Mon, 26 Sep 2011 09:04:51 -0700 (PDT) MIME-Version: 1.0 Received: by 10.68.9.7 with SMTP id v7mr30558647pba.94.1317053091018; Mon, 26 Sep 2011 09:04:51 -0700 (PDT) Received: by 10.68.46.233 with HTTP; Mon, 26 Sep 2011 09:04:50 -0700 (PDT) In-Reply-To: <1317051787-24142-1-git-send-email-sangwook.lee@linaro.org> References: <1317051787-24142-1-git-send-email-sangwook.lee@linaro.org> Date: Mon, 26 Sep 2011 17:04:50 +0100 Message-ID: Subject: Fwd: [PATCH v2] net:rfkill: add a gpio setup function into GPIO rfkill From: Sangwook Lee To: Patch Tracking ---------- Forwarded message ---------- From: Sangwook Lee Date: 26 September 2011 16:43 Subject: [PATCH v2] net:rfkill: add a gpio setup function into GPIO rfkill To: Rhyland Klein , Johannes Berg < johannes@sipsolutions.net> Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Sangwook Lee Add a gpio setup function which gives a chance to set up platform specific configuration such as pin multiplexing, input/output direction at the runtime or booting time. Signed-off-by: Sangwook Lee v2: - fixed the return type after checking gpio_runtime_setup --- include/linux/rfkill-gpio.h | 2 ++ net/rfkill/rfkill-gpio.c | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) len = strlen(pdata->name); -- 1.7.4.1 diff --git a/include/linux/rfkill-gpio.h b/include/linux/rfkill-gpio.h index a175d05..786e7bb 100644 --- a/include/linux/rfkill-gpio.h +++ b/include/linux/rfkill-gpio.h @@ -30,6 +30,7 @@ * @reset_gpio: GPIO which is used for reseting rfkill switch * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch * @power_clk_name: [optional] name of clk to turn off while blocked + * @gpio_runtime_setup: set up platform specific gpio configuration */ struct rfkill_gpio_platform_data { @@ -38,6 +39,7 @@ struct rfkill_gpio_platform_data { int shutdown_gpio; const char *power_clk_name; enum rfkill_type type; + int (*gpio_runtime_setup)(struct platform_device *); }; #endif /* __RFKILL_GPIO_H */ diff --git a/net/rfkill/rfkill-gpio.c b/net/rfkill/rfkill-gpio.c index 256c5dd..96a910c 100644 --- a/net/rfkill/rfkill-gpio.c +++ b/net/rfkill/rfkill-gpio.c @@ -101,6 +101,14 @@ static int rfkill_gpio_probe(struct platform_device *pdev) if (!rfkill) return -ENOMEM; + if (pdata->gpio_runtime_setup) { + ret = pdata->gpio_runtime_setup(pdev); + if (ret) { + pr_warn("%s: can't set up gpio\n", __func__); + return ret; + } + } + rfkill->pdata = pdata;