From patchwork Wed Jan 29 12:45:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 23836 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vc0-f198.google.com (mail-vc0-f198.google.com [209.85.220.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 4EEBE20300 for ; Wed, 29 Jan 2014 12:45:55 +0000 (UTC) Received: by mail-vc0-f198.google.com with SMTP id lf12sf3825430vcb.5 for ; Wed, 29 Jan 2014 04:45:54 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=KW5IgrrwQVMpe06Kcvxk8L8llS5WrQ3JsXvzU6t9jqg=; b=E37I4ARXy/HVRT1vqBcqFNoChsllQelEmF2BlNqJ6Nl9g46SK68I61aN9kOBueMt9q /+XJodRjt1F8z1F/vm61JtQ0R9eXLt0TjUKiG6jJjXFMhF5T4pQno1YVtJl/LZh0nTz0 Z91YsWpKqVGitSLkBiMeW58zM4hJ3AMMVpXE1vqcoPf0MkrezJObA+0bECFNaLf0L7nn 0MswXTHVz0RBhfx6i4mGIc1mlQp9MBvVTQZXprll8Vv29lQ06uN9jDv08EBosDVKTcX5 m/NHCB7xMQIs23H+GuMYK7vbtj+ZLjvKgrow4GAQ+0b0Fg1/ro1Q8b74iK3diupMMsgE lzLw== X-Gm-Message-State: ALoCoQnfJFg7DPtVcK4/KhJYb4PPEAXwE6bIcrfWUP6TF+ErvRemoF8ogvPW8oog7A/69IgTtHlK X-Received: by 10.58.85.3 with SMTP id d3mr1816189vez.40.1390999554293; Wed, 29 Jan 2014 04:45:54 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.82.166 with SMTP id h35ls67861qgd.77.gmail; Wed, 29 Jan 2014 04:45:54 -0800 (PST) X-Received: by 10.220.164.80 with SMTP id d16mr6387878vcy.15.1390999554160; Wed, 29 Jan 2014 04:45:54 -0800 (PST) Received: from mail-ve0-f178.google.com (mail-ve0-f178.google.com [209.85.128.178]) by mx.google.com with ESMTPS id we7si764178vcb.7.2014.01.29.04.45.54 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 04:45:54 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.178; Received: by mail-ve0-f178.google.com with SMTP id oy12so1120240veb.23 for ; Wed, 29 Jan 2014 04:45:54 -0800 (PST) X-Received: by 10.220.99.7 with SMTP id s7mr6400368vcn.19.1390999554084; Wed, 29 Jan 2014 04:45:54 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.174.196 with SMTP id u4csp109833vcz; Wed, 29 Jan 2014 04:45:53 -0800 (PST) X-Received: by 10.194.83.9 with SMTP id m9mr1635857wjy.39.1390999552893; Wed, 29 Jan 2014 04:45:52 -0800 (PST) Received: from mail-wg0-f51.google.com (mail-wg0-f51.google.com [74.125.82.51]) by mx.google.com with ESMTPS id lk12si2994292wic.0.2014.01.29.04.45.52 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 29 Jan 2014 04:45:52 -0800 (PST) Received-SPF: neutral (google.com: 74.125.82.51 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=74.125.82.51; Received: by mail-wg0-f51.google.com with SMTP id z12so3433056wgg.30 for ; Wed, 29 Jan 2014 04:45:52 -0800 (PST) X-Received: by 10.195.12.200 with SMTP id es8mr17541wjd.77.1390999552437; Wed, 29 Jan 2014 04:45:52 -0800 (PST) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id gc5sm5180333wib.0.2014.01.29.04.45.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Jan 2014 04:45:51 -0800 (PST) From: Linus Walleij To: arm@kernel.org Cc: linux-arm-kernel@lists.infradead.org, Linus Walleij Subject: [PATCH] ARM: iop32x: fix reset handling for the EM7210 board Date: Wed, 29 Jan 2014 13:45:45 +0100 Message-Id: <1390999545-31428-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.5.3 X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.178 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This board was missed when converting all the others to proper abstracted GPIO handling. Fix it up the right way by requesting and driving GPIO line 0 high through gpiolib to reset the machine. Reported-by: Arnd Bergmann Signed-off-by: Linus Walleij --- ARM SoC folks, if you're happy with this fix, please apply it directly to fixes in the ARM SoC tree. --- arch/arm/mach-iop32x/em7210.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/arch/arm/mach-iop32x/em7210.c b/arch/arm/mach-iop32x/em7210.c index 177cd073a83b..e0c4187f3799 100644 --- a/arch/arm/mach-iop32x/em7210.c +++ b/arch/arm/mach-iop32x/em7210.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -176,14 +177,21 @@ static struct platform_device em7210_serial_device = { .resource = &em7210_uart_resource, }; +#define EM7210_HARDWARE_RESET 0 + void em7210_power_off(void) { - *IOP3XX_GPOE &= 0xfe; - *IOP3XX_GPOD |= 0x01; + int ret; + + ret = gpio_direction_output(EM7210_HARDWARE_RESET, 1); + if (ret) + pr_crit("could not drive reset GPIO high\n"); } static void __init em7210_init_machine(void) { + int ret; + register_iop32x_gpio(); platform_device_register(&em7210_serial_device); platform_device_register(&iop3xx_i2c0_device); @@ -194,7 +202,9 @@ static void __init em7210_init_machine(void) i2c_register_board_info(0, em7210_i2c_devices, ARRAY_SIZE(em7210_i2c_devices)); - + ret = gpio_request(EM7210_HARDWARE_RESET, "reset"); + if (ret) + pr_err("could not request reset GPIO\n"); pm_power_off = em7210_power_off; }