Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp643835imu; Wed, 9 Jan 2019 04:05:30 -0800 (PST) X-Google-Smtp-Source: ALg8bN5RL0W3q3cYO5z/h8xfoR5e04TcG3M1ER54YzgbYceLANxig8JAgRNcnqQYgWDuc4VXVy8k X-Received: by 2002:a63:fd0a:: with SMTP id d10mr5182011pgh.164.1547035530444; Wed, 09 Jan 2019 04:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547035530; cv=none; d=google.com; s=arc-20160816; b=r723QbpE9XAtUki18iijMDMGR+iZZ/SfIX9v+FO3HGDWQ5yKKxDLxBbxmX3/+QneXL El12NcMNbJ1AsTTCR0+SlSoNSllxDTXOYLyboMlv0bNbt+fDTlhs3wWMaPuJv8fma5Kv i9GDrvS+Q5iz/vLTGPPPix6SvIfx6roTMCw5n/C05cvRYc9z1mrNhf9heNLk8k3bC5OS 8cVGspuwovN0Gud/wsGWmlhQkR+Q+zOzln8hxH6Nat3eAmu4nnVcaCg7NiPwJQNFQ9eh xVWK3SMBRSGUartoYr63MUOqA72wfsUAkFBvdSVcuho33KDewVsXGpi2pkgh6g/NPmfI zLlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=5bnCElsR2YQ1UtJOKP5sc5ZGiYKE6tkungMtChwQfZQ=; b=nOgMj9bCGtTEC7fCEuj7YmqO5oXSN5KUSijeaR630QZGcvxbV7O278fWZYRX92pjuK igqr+T2CzkEMLtV0KzKvchVhCf3JdgJlkYN00+4wu18pR7dVm0IsQQL9dCU+E80f1shb neIah+f/pPl/YE7bfsAqE6MV94RGJbtKR+DEbmw4Ydu9mepy/Vvakz6K8jv8x1zyTqqC 7e5tdvq/aCmkgENg0ylhlpKpKyOEXw2FIlzTigDykud0oddexT1cbQAOs6Z19bP7tfLV CYeU8RMg22pmoAjNXIsvBP2uC2h3QgmpH5MjhtQv1DgZbFb6vOrregcNQKQDIWu+qxGR cOWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OZGmTKUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1si67117672plb.103.2019.01.09.04.05.14; Wed, 09 Jan 2019 04:05:30 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=OZGmTKUZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730715AbfAILam (ORCPT + 99 others); Wed, 9 Jan 2019 06:30:42 -0500 Received: from mail-lf1-f68.google.com ([209.85.167.68]:37596 "EHLO mail-lf1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730392AbfAILam (ORCPT ); Wed, 9 Jan 2019 06:30:42 -0500 Received: by mail-lf1-f68.google.com with SMTP id y11so5377275lfj.4 for ; Wed, 09 Jan 2019 03:30:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5bnCElsR2YQ1UtJOKP5sc5ZGiYKE6tkungMtChwQfZQ=; b=OZGmTKUZo9E/nPrTg1QY7UrfKEGpHT1czaA6veFM8hFCz6gWGr9EuUmC0Baq2BY7Sm l1oZGsx3LB4IFX1nZzuKwpmoyCUvNmcmCW7etZHQuzpnQPoJMVW4v2kP18UdNCKgx99I K23yffgNhMJu27dodOGnd6q18XyPdXT8ETYHsETstctD0JMOgcBat770SiXvVTSM4IH/ eHQOxPEwuP1quRDrXNoMU2Y01vA3qjJ4o6v8FfuE7+25ih5INy4pd71a3rWFVhkJ+GLQ YQJArpRl/0bWM406Wj2p5caFhiRFwjiBAH3baUAukvVBPVaaOIaoZf+DxXQKtMfnf1V+ 2dRg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=5bnCElsR2YQ1UtJOKP5sc5ZGiYKE6tkungMtChwQfZQ=; b=YP1Ow/6Xu4c+WuDbrdw03sQVcxRnQf0SDbPwtRb/Xe1dThPLAWLzqUOZQxI/9b4WNX 8qDZJHtiRinJAbuc+J/X7pPxrK8EZE4/0bg8arkWBHyr55uh0UY5sDDLRZeQrythrnL2 /qnlGvXeuZUXeegj9ogrUqpMDERz7Dmn0kDeHCoAIRl4ObQ9jpgW5U2P7MLvMOX5458h ird6ftWhpmc+/KVeXo2D/AobycB98HQiHKJTqA6EBc+x8vzMksEfPYDZN3PLfyeWjg3Y ZQ0zSq9gyssf1vnPBH4OI11Cm6c6m3+DSqZPzP5KdbMHBvVONNB6ehJOLrVM1lWUI08p Omzg== X-Gm-Message-State: AJcUukevTaNxOdmv6n6gm8EciZ6QTCyxaZ2XJCT8geBe8Sm2HzXHEFXG 9lXfKVta22YmwIlN3RTz/FI= X-Received: by 2002:a19:f20:: with SMTP id e32mr3368544lfi.51.1547033440224; Wed, 09 Jan 2019 03:30:40 -0800 (PST) Received: from xi.terra (c-74bee655.07-184-6d6c6d4.bbcust.telenor.se. [85.230.190.116]) by smtp.gmail.com with ESMTPSA id b20sm13447002lfj.61.2019.01.09.03.30.39 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 09 Jan 2019 03:30:39 -0800 (PST) Received: from johan by xi.terra with local (Exim 4.91) (envelope-from ) id 1ghC4J-0008O7-0k; Wed, 09 Jan 2019 12:30:43 +0100 Date: Wed, 9 Jan 2019 12:30:43 +0100 From: Johan Hovold To: Nishad Kamdar Cc: Johan Hovold , Greg Kroah-Hartman , Alex Elder , Rui Miguel Silva , greybus-dev@lists.linaro.org, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v4 3/4] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface Message-ID: <20190109113043.GK14782@localhost> References: <54ba56b6b071ba48ca06713a108ccfb542c5d2e5.1545488665.git.nishadkamdar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <54ba56b6b071ba48ca06713a108ccfb542c5d2e5.1545488665.git.nishadkamdar@gmail.com> User-Agent: Mutt/1.11.1 (2018-12-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 22, 2018 at 08:22:09PM +0530, Nishad Kamdar wrote: > Use the gpiod interface instead of the deprecated old non-descriptor > interface. > > Signed-off-by: Nishad Kamdar > --- > Changes in v4: > - Use gpiod_set_raw_value() for deassert_reset() and > assert_reset() as gpiod_set_value() will change the > sematics of these calls by taking any gpio flags > into account. Please also mention this in the commit message (i.e. that we continue to ignore gpio flags from device tree for now). > - Remove some unnecesssary line breaks. > - Restore 'spi_en' gpio check in fw_flashing_seq() > as it is currently optional. > Changes in v3: > - Add this patch in a patchset. > Changes in v2: > - Resolved compilation errors. > --- > @@ -75,11 +74,10 @@ static int coldboot_seq(struct platform_device *pdev) > return 0; > > /* Hold APB in reset state */ > - assert_reset(apb->resetn_gpio); > + assert_reset(apb->resetn); > > - if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && > - gpio_is_valid(apb->spi_en_gpio)) > - devm_gpio_free(dev, apb->spi_en_gpio); > + if (apb->state == ARCHE_PLATFORM_STATE_FW_FLASHING && apb->spi_en) > + devm_gpiod_put(dev, apb->spi_en); > > /* Enable power to APB */ > if (!IS_ERR(apb->vcore)) { > @@ -101,13 +99,13 @@ static int coldboot_seq(struct platform_device *pdev) > apb_bootret_deassert(dev); > > /* On DB3 clock was not mandatory */ > - if (gpio_is_valid(apb->clk_en_gpio)) > - gpio_set_value(apb->clk_en_gpio, 1); > + if (apb->clk_en) > + gpiod_set_value(apb->clk_en, 1); > > usleep_range(100, 200); > > /* deassert reset to APB : Active-low signal */ > - deassert_reset(apb->resetn_gpio); > + deassert_reset(apb->resetn); > > apb->state = ARCHE_PLATFORM_STATE_ACTIVE; > > @@ -136,25 +134,25 @@ static int fw_flashing_seq(struct platform_device *pdev) > return ret; > } > > - if (gpio_is_valid(apb->spi_en_gpio)) { > + if (apb->spi_en) { > unsigned long flags; > > if (apb->spi_en_polarity_high) > - flags = GPIOF_OUT_INIT_HIGH; > + flags = GPIOD_OUT_HIGH; > else > - flags = GPIOF_OUT_INIT_LOW; > + flags = GPIOD_OUT_LOW; > > - ret = devm_gpio_request_one(dev, apb->spi_en_gpio, > - flags, "apb_spi_en"); > - if (ret) { > - dev_err(dev, "Failed requesting SPI bus en gpio %d\n", > - apb->spi_en_gpio); > + apb->spi_en = devm_gpiod_get(dev, "gb,spi-en-gpio", flags); I just noticed that you change the name of the device-tree property here (and later in apb_ctrl_get_devtree_data()). How is that expected to work without breaking current systems? This will be unavoidable at some point, but must not be snuck into a patch like this without any comment. Please keep the current names for now. I do think you need to drop the "-gpio" suffix when requesting the gpio though. Please double check to make sure. Johan