From patchwork Sun Feb 23 16:37:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Barinov X-Patchwork-Id: 3704331 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C0AFE9F35F for ; Sun, 23 Feb 2014 16:38:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB68F201C7 for ; Sun, 23 Feb 2014 16:38:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECC0820107 for ; Sun, 23 Feb 2014 16:38:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751300AbaBWQhx (ORCPT ); Sun, 23 Feb 2014 11:37:53 -0500 Received: from mail-la0-f52.google.com ([209.85.215.52]:46450 "EHLO mail-la0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbaBWQhv (ORCPT ); Sun, 23 Feb 2014 11:37:51 -0500 Received: by mail-la0-f52.google.com with SMTP id c6so4337806lan.25 for ; Sun, 23 Feb 2014 08:37:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=aw9oEkBhHTAqhqJBZIaIcS/wAj5DGo71pJjyDPuS6C8=; b=WDTXP9y8ZDih/856Ps+kApwnIXQyKqpzp4BF6nggJdiLZzWg/gyZxsC194I/QLZd/3 Xsvv/6S3EDP+DC+7xiO8dpeJavk1FUCVh+CtKCRz2F5g6FHJsAAYk0NJ8Jxf1+us0pi1 my11g1+8rzI3LgwS6v0GOB7TVm3+JcrgjVvFy2KsnVGEFnJIMTUXHCstfHk4Vb4vMjjK HYcA2+8eKxTaJBQpGWFn9/8ZhF2y7C0SY2gZmdiKnI4a07RVG2gIPrtR++CR9KgGWLYt mDO8AR5IPhMxxh1ZqwNzPuWfLUsnMWQiXrSUuRwJg4/0x+J0ZcKbSbjJeG8IUtNug54i 6bbA== X-Gm-Message-State: ALoCoQkBk/cyx48+/WcxDY/NP3om7gggzRyvYmUgF0uEmowrgBDkFchzuC18Pmlc3ouLNKGAx+bR X-Received: by 10.152.9.65 with SMTP id x1mr9753194laa.6.1393173469762; Sun, 23 Feb 2014 08:37:49 -0800 (PST) Received: from localhost.localdomain ([46.32.73.80]) by mx.google.com with ESMTPSA id gi5sm15443411lbc.4.2014.02.23.08.37.48 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Sun, 23 Feb 2014 08:37:48 -0800 (PST) From: To: Cc: , linux-gpio@vger.kernel.org, , , , , Subject: [PATCH] gpio: gpio-rcar: init at postcore level Date: Sun, 23 Feb 2014 20:37:47 +0400 Message-Id: <1393173467-12240-1-git-send-email-vladimir.barinov@cogentembedded.com> X-Mailer: git-send-email 1.7.5.4 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Vladimir Barinov This adds ability to use gpio API at board init_machine level. F.e. it can be used in the following situation. Many reference hardware has onboard switches that selects which periferals to connect to the system. The gpio input state from switches can be used in choosing platform devices runtime in board code instead of ifdefs/defconfig changes. Signed-off-by: --- drivers/gpio/gpio-rcar.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: build/drivers/gpio/gpio-rcar.c =================================================================== --- build.orig/drivers/gpio/gpio-rcar.c 2014-02-22 23:21:51.456229152 +0400 +++ build/drivers/gpio/gpio-rcar.c 2014-02-22 23:21:52.320229133 +0400 @@ -485,7 +485,17 @@ } }; -module_platform_driver(gpio_rcar_device_driver); +static int __init gpio_rcar_init(void) +{ + return platform_driver_register(&gpio_rcar_device_driver); +} +postcore_initcall(gpio_rcar_init); + +static void __exit gpio_rcar_exit(void) +{ + platform_driver_unregister(&gpio_rcar_device_driver); +} +module_exit(gpio_rcar_exit); MODULE_AUTHOR("Magnus Damm"); MODULE_DESCRIPTION("Renesas R-Car GPIO Driver");