Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2554024imu; Sun, 13 Jan 2019 04:57:10 -0800 (PST) X-Google-Smtp-Source: ALg8bN7ISfUka0C6rH5eZGn01VzhB83qbjkn46MevVURvXJxMU/hngv/MB/U8agMTHfgYjzrVcC7 X-Received: by 2002:a17:902:c5:: with SMTP id a63mr22074344pla.267.1547384230222; Sun, 13 Jan 2019 04:57:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547384230; cv=none; d=google.com; s=arc-20160816; b=a6bW4uL2GUdJ60GEKnQjaN6242A1jptbka3zhNwOH7+VJFAkQvqEM/zmhPLofhmcC8 7uhLE9BxBIwU0DxYJydm7841KZEy8SV/UIj/KN4ChD/NE7lWJ8h4gwkeKFkgGG2Ckxft P+QSL8FwV0da99RmG9ltJeyZCcycP4VDhmrTeDwFgLhAMLbtcVV3w6nHa2v77eIaGuN+ ETW/neJGhAgxJXQAmbq2vETpcuP0GRK3qK8YRfWdUrO5F9JE+wz5Z+SBgsx+1K7BE/Ld m0lfCl+vm71D4RXuaqpdXmXeYvQCWofox4XrVdQ6nsCelsGSGQoWvEFBsBEYdKqbSE5A ccNw== 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=8/Q4l1jgysTNdOIsGe3KhRDq4zDNW7A/D6UCubA34L0=; b=oPodOPgBibDnNATIOQ7W8xRboh2+ZAjVF8TWUwYYwqYYi+s+WhLeWxoY9by9GPnB6i pP07KjZ8Y8RyaUNEkl0vm5P3Aa2f+N0Dpqp4PMOE6MqJVwmxTOF3C4opwhOjtHnQ9f5Z sgCyWW75zz9ALlx7sgLVIfJojhhkux2mdhc9dJUiFwT4p6RdB3tHt9oNgL4bkTukRItX WjcUFT4X7oHNmHpPdZCya4c3PHmt7NWlNDwTZZp5a4BNuHhL2wcfnF0DAzemvr5H1SyG +xUBcwniB2XYll8IP14sqz44Frr3lqRfqbzEGtPr20Wjj2a1oVzA4bOQDvo8gR89tT9e 1lFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YV7Wi/KD"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3si13449311pld.282.2019.01.13.04.56.54; Sun, 13 Jan 2019 04:57:10 -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=pass header.i=@gmail.com header.s=20161025 header.b="YV7Wi/KD"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726546AbfAMMye (ORCPT + 99 others); Sun, 13 Jan 2019 07:54:34 -0500 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34042 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725875AbfAMMye (ORCPT ); Sun, 13 Jan 2019 07:54:34 -0500 Received: by mail-pl1-f193.google.com with SMTP id w4so8899745plz.1 for ; Sun, 13 Jan 2019 04:54:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=8/Q4l1jgysTNdOIsGe3KhRDq4zDNW7A/D6UCubA34L0=; b=YV7Wi/KDN8ptVezMge/+EsoIpkARkBAhR/EnTVbNVgmuojPJ9ANvw9EuZmd4WBGioF 3d43z9xkIe6Rt880tiqs2Fe3NbtYqqwcD74l0AD31n31mFtZhdbZ9jgBjhlbocyQwX3p eCEiYTm6HZfIffpKXWQngfDPtGYhIZiFOwADYG0JTPyKPRwEIeKZZvgheZSU93JNMKDC iYdstAuhsVWVEkitodKQ93MYY5dJSEVbbJAedXQu7LSAHtno1bxb5PaRXCMzt3lso3F+ Tmv+Ei7wlOuOPLcyG+Tbd8mjhf52OyDC7Ph/wPYLX+oTcVPfMSgOffbMLs22e+c6pihZ /oDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=8/Q4l1jgysTNdOIsGe3KhRDq4zDNW7A/D6UCubA34L0=; b=dBe4sY+C1PHd0FYtx/QOCwzHQV3duXcnsm1+52hj2SVFOVr9P+bi/6S0FSyfTV9i7K 2sUATtTt1MCpKoZcXvOKPOng4Kk9uaiO1xjN2l93NA3dl3cZUoJxhMGJSdLubBk2BP8y mc7Vlut+HcUX9+/0a5Rcck7OFnBOnWgCz8M7HZS5O7sgx7yE2ItqYKE3dZCpyRytQ0Az aDbuYOgjIkyzb1Hs/j3bCmh90knFmx3ALSJ5vXPjADD5+wskmLj3KHwEV/rT5jDUigxH Nri4RUzLov6KBURNrEoVVTE9ZkBAX1SNvZpYK1HejkRQa0N6B8KkOK8wAY3knwws8AXM 2atg== X-Gm-Message-State: AJcUukd+KTH30oxo0lAFtJvAmE5CCVciedQl1UT4yDwOpTXKYKkD4BXZ wJWz2ISm5R/dLbLCCK2mCB8= X-Received: by 2002:a17:902:2aa8:: with SMTP id j37mr20763234plb.226.1547384073265; Sun, 13 Jan 2019 04:54:33 -0800 (PST) Received: from nishad ([106.51.25.107]) by smtp.gmail.com with ESMTPSA id z191sm105834313pgd.74.2019.01.13.04.54.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 13 Jan 2019 04:54:32 -0800 (PST) Date: Sun, 13 Jan 2019 18:24:25 +0530 From: Nishad Kamdar To: Johan Hovold 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 v5 2/3] staging: greybus: arche-apb-ctrl.c: Switch to the gpio descriptor interface Message-ID: <20190113125424.GB16542@nishad> References: <0f65372f6f223244f7125d074816d5da9e513a8b.1547141413.git.nishadkamdar@gmail.com> <20190111084134.GC3383@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190111084134.GC3383@localhost> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 11, 2019 at 09:41:34AM +0100, Johan Hovold wrote: > On Thu, Jan 10, 2019 at 11:21:04PM +0530, Nishad Kamdar wrote: > > Use the gpiod interface instead of the deprecated old non-descriptor > > interface while continuing to ignore gpio flags from device tree in > > functions "deassert_reset()" and "assert_reset()" for now. > > > > Signed-off-by: Nishad Kamdar > > --- > > Changes in v5: > > - Change the commit message. > > - Restore the names of the gpio device-tree properties without > > the "-gpio" suffix. > > 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. > > - 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. > > --- > > Also looks good now. You can add my > > Reviewed-by: Johan Hovold > > Found one really minor nit below, which doesn't really need to be fixed, > but since you may need to update the third patch, you might as well > consider this too. > Ok, I'll do that. > > /* It's not mandatory to support power management interface */ > > - apb->pwroff_gpio = of_get_named_gpio(np, "pwr-off-gpios", 0); > > - if (apb->pwroff_gpio < 0) { > > - dev_err(dev, "failed to get power off gpio\n"); > > - return apb->pwroff_gpio; > > - } > > - ret = devm_gpio_request_one(dev, apb->pwroff_gpio, > > - GPIOF_IN, "pwroff_n"); > > - if (ret) { > > - dev_err(dev, "Failed requesting pwroff_n gpio %d\n", > > - apb->pwroff_gpio); > > + apb->pwroff = devm_gpiod_get_optional(dev, "pwr-off", > > + GPIOD_IN); > > Looks like you don't need to break the above statement any more either. > > > + if (IS_ERR(apb->pwroff)) { > > + ret = PTR_ERR(apb->pwroff); > > + dev_err(dev, "Failed requesting pwroff_n GPIO: %d\n", ret); > > return ret; > > } > > > > /* Do not make clock mandatory as of now (for DB3) */ > > - apb->clk_en_gpio = of_get_named_gpio(np, "clock-en-gpio", 0); > > - if (apb->clk_en_gpio < 0) { > > - dev_warn(dev, "failed to get clock en gpio\n"); > > - } else if (gpio_is_valid(apb->clk_en_gpio)) { > > - ret = devm_gpio_request_one(dev, apb->clk_en_gpio, > > - GPIOF_OUT_INIT_LOW, "apb_clk_en"); > > - if (ret) { > > - dev_warn(dev, "Failed requesting APB clock en gpio %d\n", > > - apb->clk_en_gpio); > > - return ret; > > - } > > + apb->clk_en = devm_gpiod_get_optional(dev, "clock-en", > > + GPIOD_OUT_LOW); > > Same here? > Ok, I'll do that. Thanks and regards, Nishad > > + if (IS_ERR(apb->clk_en)) { > > + ret = PTR_ERR(apb->clk_en); > > + dev_err(dev, "Failed requesting APB clock en GPIO: %d\n", ret); > > + return ret; > > } > > Johan