From patchwork Mon Sep 26 14:22:52 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sangwook X-Patchwork-Id: 4333 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 7F7C523EF6 for ; Mon, 26 Sep 2011 14:24:46 +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 64E31A18A8F for ; Mon, 26 Sep 2011 14:24:46 +0000 (UTC) Received: by mail-fx0-f52.google.com with SMTP id 23so8388754fxe.11 for ; Mon, 26 Sep 2011 07:24:46 -0700 (PDT) Received: by 10.223.30.151 with SMTP id u23mr1276292fac.122.1317047086183; Mon, 26 Sep 2011 07:24:46 -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 f10cs39398laf; Mon, 26 Sep 2011 07:24:45 -0700 (PDT) Received: by 10.213.3.211 with SMTP id 19mr1089412ebo.28.1317047085374; Mon, 26 Sep 2011 07:24:45 -0700 (PDT) Received: from mail-ey0-f178.google.com (mail-ey0-f178.google.com [209.85.215.178]) by mx.google.com with ESMTPS id f56si5881664eea.137.2011.09.26.07.24.44 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 26 Sep 2011 07:24:45 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.215.178 is neither permitted nor denied by best guess record for domain of sangwook.lee@linaro.org) client-ip=209.85.215.178; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.215.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 eye27 with SMTP id 27so4598820eye.37 for ; Mon, 26 Sep 2011 07:24:44 -0700 (PDT) Received: by 10.213.21.194 with SMTP id k2mr2115922ebb.53.1317047083997; Mon, 26 Sep 2011 07:24:43 -0700 (PDT) Received: from localhost.localdomain (host86-148-124-204.range86-148.btcentralplus.com. [86.148.124.204]) by mx.google.com with ESMTPS id v9sm60828127eej.5.2011.09.26.07.24.41 (version=SSLv3 cipher=OTHER); Mon, 26 Sep 2011 07:24:43 -0700 (PDT) From: Sangwook Lee To: Rhyland Klein , Johannes Berg Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, Sangwook Lee Subject: [PATCH] net:rfkill: add a gpio setup function into GPIO rfkill Date: Mon, 26 Sep 2011 15:22:52 +0100 Message-Id: <1317046972-18570-1-git-send-email-sangwook.lee@linaro.org> X-Mailer: git-send-email 1.7.4.1 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 --- include/linux/rfkill-gpio.h | 2 ++ net/rfkill/rfkill-gpio.c | 8 ++++++++ 2 files changed, 10 insertions(+), 0 deletions(-) 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..d6cec90 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 -EINVAL; + } + } + rfkill->pdata = pdata; len = strlen(pdata->name);