From patchwork Tue Mar 29 20:35:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ezequiel Garcia X-Patchwork-Id: 8690991 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0F1FDC0553 for ; Tue, 29 Mar 2016 20:38:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 27CA420374 for ; Tue, 29 Mar 2016 20:38:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3BB2720361 for ; Tue, 29 Mar 2016 20:38:49 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1al0Nz-0000mz-3g; Tue, 29 Mar 2016 20:37:11 +0000 Received: from mail-qk0-x22c.google.com ([2607:f8b0:400d:c09::22c]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1al0NP-00007i-0b for linux-arm-kernel@lists.infradead.org; Tue, 29 Mar 2016 20:36:36 +0000 Received: by mail-qk0-x22c.google.com with SMTP id x64so11420658qkd.1 for ; Tue, 29 Mar 2016 13:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=dIrQdPSvv6555nFTzSzKA4tGAgFVQxoMpdEZyg5Awnk=; b=DQIAkrTxyK7ZLd+M9gzi/S5e1q2mo3/eeqkQZeGOQkUAnJB3U5fG7cCwplSrKrSGBl xfxxFn1uLdYWgWc5krvWN310FppYO0qPxDvKs8cJ9VbbA3wmWxycw1bzIrm9NPWrw2H8 4aJ+7FenYgvj7ptFxQxAK/9ibezdMr8Poccqml+T4DLZL6lUOBTGhUVybdYFZ/hFkX1i Xp38yWDSfjePRBEMPyOx/aveLR+3oNVC83yHlzGGhecS/vCWbbccKo75mcvH8qyiKLae nF8ULOSPFVVVeur47KOcAkOM6XuqKMCKJHdCddtPUUud1f0eAxLKLj8rAA6SmQqstNyV NC+w== 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:in-reply-to :references; bh=dIrQdPSvv6555nFTzSzKA4tGAgFVQxoMpdEZyg5Awnk=; b=BhAgFBFcPh5qhUECsZZG2t7KjlM9h9/TjAemqRYfvOiMmcOqtDh+85xrsY190PUxkQ pncpILwkGfiRCz33tEIzCal2trNWNNqlu/jPox8H6690bRDcKQrE+I0TqHlg4Lb/hZ4o o8RjTopcmLZQvThUUwLcILPOcGqsUOMC740L/1Ii+lpxA4Uyt5xa7eXJdrOs7SF3c/yH nd/cw09aPAY5NmZJFD5t0FE6v/syqlqRhzz7mEbEDOPBUrVPrSKEtHcD+FQWJGA5XRF4 YSnQv4ScX7B25zyXSWd8AgQANYkO9Xwd6YV003AKpeCPUyvie/yD39IpbB4upaJBd0jR l/9Q== X-Gm-Message-State: AD7BkJKvtVUTAait6LwitZadVh/fmSMq9LEbAtS3H69LZHdLKB6k3LkL4/gN89iqG5f/9A== X-Received: by 10.55.77.205 with SMTP id a196mr5363092qkb.94.1459283774001; Tue, 29 Mar 2016 13:36:14 -0700 (PDT) Received: from localhost.localdomain ([190.2.108.156]) by smtp.gmail.com with ESMTPSA id a66sm228623qkb.20.2016.03.29.13.36.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 29 Mar 2016 13:36:13 -0700 (PDT) From: Ezequiel Garcia To: , Subject: [PATCH 3/3] ARM: s3c24xx: Use the panic LED trigger for GTA02 Date: Tue, 29 Mar 2016 17:35:49 -0300 Message-Id: <1459283749-22451-4-git-send-email-ezequiel@vanguardiasur.com.ar> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1459283749-22451-1-git-send-email-ezequiel@vanguardiasur.com.ar> References: <1459283749-22451-1-git-send-email-ezequiel@vanguardiasur.com.ar> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160329_133635_310778_1189DA79 X-CRM114-Status: GOOD ( 12.57 ) X-Spam-Score: -2.6 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, kgene@kernel.org, Richard Purdie , Jacek Anaszewski , Ezequiel Garcia MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 Let's take advantage of the recently introduced panic LED trigger, and get rid of the open-coded panic_blink usage. Built tested only. Signed-off-by: Ezequiel Garcia --- arch/arm/mach-s3c24xx/mach-gta02.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-s3c24xx/mach-gta02.c b/arch/arm/mach-s3c24xx/mach-gta02.c index 27ae6877550f..e794d55abc9e 100644 --- a/arch/arm/mach-s3c24xx/mach-gta02.c +++ b/arch/arm/mach-s3c24xx/mach-gta02.c @@ -71,6 +71,7 @@ #include #include #include +#include #include #include @@ -89,22 +90,6 @@ static struct pcf50633 *gta02_pcf; -/* - * This gets called frequently when we paniced. - */ - -static long gta02_panic_blink(int state) -{ - long delay = 0; - char led; - - led = (state) ? 1 : 0; - gpio_direction_output(GTA02_GPIO_AUX_LED, led); - - return delay; -} - - static struct map_desc gta02_iodesc[] __initdata = { { .virtual = 0xe0000000, @@ -500,6 +485,20 @@ static struct platform_device gta02_buttons_device = { }, }; +static struct s3c24xx_led_platdata gta02_panic_led_pdata = { + .name = "panic", + .gpio = GTA02_GPIO_AUX_LED, + .def_trigger = "panic", +}; + +static struct platform_device gta02_panic_led_device = { + .name = "s3c24xx_led", + .id = -1, + .dev = { + .platform_data = >a02_panic_led_pdata, + }, +}; + static void __init gta02_map_io(void) { s3c24xx_init_io(gta02_iodesc, ARRAY_SIZE(gta02_iodesc)); @@ -563,9 +562,7 @@ static void gta02_poweroff(void) static void __init gta02_machine_init(void) { - /* Set the panic callback to turn AUX LED on or off. */ - panic_blink = gta02_panic_blink; - + platform_device_register(>a02_panic_led_device); s3c_pm_init(); #ifdef CONFIG_CHARGER_PCF50633