From patchwork Tue Sep 10 12:31:00 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 19852 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-vb0-f71.google.com (mail-vb0-f71.google.com [209.85.212.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 703EA246A4 for ; Tue, 10 Sep 2013 12:31:08 +0000 (UTC) Received: by mail-vb0-f71.google.com with SMTP id g17sf8686088vbg.10 for ; Tue, 10 Sep 2013 05:31:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=mime-version:x-gm-message-state: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=sXyMzoKOm0UNbgKZzKwgIzxdDUdX0K8jSNLMNU/hg7U=; b=a+xYKENn6oQm7ZsEqyUcmbYwzG7zFMv1P1VpgOPssBPmhZ7uvluBYepJF8iKDktJXM NqFUhJElqojetg/HevCEYckm7wVv42b8jBmPeRmDO1TedqzVVhwj+6CZdIMneqkmpgSt pNMGIky/Q5HQv3NevBQylP1k4eyS1krP+9ng46dmSCWf6hiz3Ea/nH22xW6C6k91R0mM 6/NNbC6CTWj9F17GWF1BkvjNOdpsfIcaLvEgUln+5j+sK4x9Zek+Pk2nzxbjo9NwzUgI AGlIjK9zmJGACmcWatDOVyZIFcreCGkT+P5LI6oS7ReYXy/etVwkdf4RA+hIaEk9eKHk NqhQ== X-Received: by 10.236.90.67 with SMTP id d43mr8189167yhf.36.1378816268138; Tue, 10 Sep 2013 05:31:08 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.104.111 with SMTP id gd15ls2214836qeb.68.gmail; Tue, 10 Sep 2013 05:31:07 -0700 (PDT) X-Received: by 10.58.67.9 with SMTP id j9mr1305265vet.22.1378816267913; Tue, 10 Sep 2013 05:31:07 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id v6si4388347vet.38.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:07 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.171 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id ij15so4949157vcb.16 for ; Tue, 10 Sep 2013 05:31:07 -0700 (PDT) X-Gm-Message-State: ALoCoQkY3h7Yd1kY/OI12f6GHmnkW1WJ+WmUUgHOSfljIgYXYB1JJlH7C9icLNNQ37he2AS/ppKf X-Received: by 10.58.208.130 with SMTP id me2mr22909663vec.13.1378816267815; Tue, 10 Sep 2013 05:31:07 -0700 (PDT) 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 u4csp18430vcz; Tue, 10 Sep 2013 05:31:07 -0700 (PDT) X-Received: by 10.152.115.242 with SMTP id jr18mr1128752lab.40.1378816266628; Tue, 10 Sep 2013 05:31:06 -0700 (PDT) Received: from mail-lb0-f177.google.com (mail-lb0-f177.google.com [209.85.217.177]) by mx.google.com with ESMTPS id ao5si7825103lac.159.1969.12.31.16.00.00 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:06 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.217.177 is neither permitted nor denied by best guess record for domain of linus.walleij@linaro.org) client-ip=209.85.217.177; Received: by mail-lb0-f177.google.com with SMTP id p5so6093404lbi.22 for ; Tue, 10 Sep 2013 05:31:06 -0700 (PDT) X-Received: by 10.152.115.176 with SMTP id jp16mr21082684lab.17.1378816266029; Tue, 10 Sep 2013 05:31:06 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id i3sm9039522laf.4.1969.12.31.16.00.00 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Tue, 10 Sep 2013 05:31:05 -0700 (PDT) From: Linus Walleij To: linux-gpio@vger.kernel.org, Imre Kaloz , Krzysztof Halasa , Richard Cochran Cc: Alexandre Courbot , linux-arm-kernel@lists.infradead.org, Linus Walleij , netdev@vger.kernel.org Subject: [PATCH 4/7] ptp: switch to use gpiolib Date: Tue, 10 Sep 2013 14:31:00 +0200 Message-Id: <1378816260-8091-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.8.3.1 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.220.171 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 platform supports gpiolib, so remove the custom API use and replace with calls to gpiolib. Also request the GPIO before starting to use it. Cc: Imre Kaloz Cc: Krzysztof Halasa Cc: Alexandre Courbot Cc: Richard Cochran Cc: netdev@vger.kernel.org Signed-off-by: Linus Walleij --- Hi Richard, I'm seeking an ACK on this patch to take it throug the GPIO tree as part of a clean-out of custom GPIO implementations. --- drivers/ptp/ptp_ixp46x.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/ptp/ptp_ixp46x.c b/drivers/ptp/ptp_ixp46x.c index d49b851..4a08727 100644 --- a/drivers/ptp/ptp_ixp46x.c +++ b/drivers/ptp/ptp_ixp46x.c @@ -259,8 +259,15 @@ static struct ixp_clock ixp_clock; static int setup_interrupt(int gpio) { int irq; + int err; - gpio_line_config(gpio, IXP4XX_GPIO_IN); + err = gpio_request(gpio, "ixp4-ptp"); + if (err) + return err; + + err = gpio_direction_input(gpio); + if (err) + return err; irq = gpio_to_irq(gpio);