From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751329AbbLUIgv (ORCPT ); Mon, 21 Dec 2015 03:36:51 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:44949 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751208AbbLUIgs (ORCPT ); Mon, 21 Dec 2015 03:36:48 -0500 Subject: Re: [PATCH v3 6/9] phy: ti-pipe3: use *syscon* framework API to power on/off the PHY To: Rob Herring References: <1450170968-11282-1-git-send-email-kishon@ti.com> <1450170968-11282-7-git-send-email-kishon@ti.com> <20151220033836.GG9883@rob-hp-laptop> CC: , , , , , , , , , , , , From: Kishon Vijay Abraham I Message-ID: <5677BA0B.4090002@ti.com> Date: Mon, 21 Dec 2015 14:06:27 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151220033836.GG9883@rob-hp-laptop> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi On Sunday 20 December 2015 09:08 AM, Rob Herring wrote: > On Tue, Dec 15, 2015 at 02:46:05PM +0530, Kishon Vijay Abraham I wrote: >> Deprecate using phy-omap-control driver to power on/off the PHY and >> use *syscon* framework to do the same. >> >> Signed-off-by: Kishon Vijay Abraham I >> --- >> Documentation/devicetree/bindings/phy/ti-phy.txt | 10 ++- >> drivers/phy/phy-ti-pipe3.c | 90 ++++++++++++++++++---- >> 2 files changed, 85 insertions(+), 15 deletions(-) > > For the binding: > > Acked-by: Rob Herring > > One comment on the driver though. > > [...] > >> --- a/drivers/phy/phy-ti-pipe3.c >> +++ b/drivers/phy/phy-ti-pipe3.c > > [...] > >> @@ -144,18 +155,53 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy); >> >> static int ti_pipe3_power_off(struct phy *x) >> { >> + u32 val; >> + int ret; >> struct ti_pipe3 *phy = phy_get_drvdata(x); >> >> - omap_control_phy_power(phy->control_dev, 0); >> + if (phy->phy_power_syscon) { > > Writing this as: > > if (!phy->phy_power_syscon) { > ... > return 0; > } > > //regmap code > > > will make it simpler to remove the deprecated code later. hmm.. I will make this change in all the applicable patches. Thanks Kishon > > >> + val = PIPE3_PHY_TX_RX_POWEROFF << >> + PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT; >> + >> + ret = regmap_update_bits(phy->phy_power_syscon, phy->power_reg, >> + PIPE3_PHY_PWRCTL_CLK_CMD_MASK, val); >> + if (ret < 0) >> + return ret; >> + } else { >> + omap_control_phy_power(phy->control_dev, 0); >> + } >> >> return 0; From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kishon Vijay Abraham I Subject: Re: [PATCH v3 6/9] phy: ti-pipe3: use *syscon* framework API to power on/off the PHY Date: Mon, 21 Dec 2015 14:06:27 +0530 Message-ID: <5677BA0B.4090002@ti.com> References: <1450170968-11282-1-git-send-email-kishon@ti.com> <1450170968-11282-7-git-send-email-kishon@ti.com> <20151220033836.GG9883@rob-hp-laptop> Mime-Version: 1.0 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20151220033836.GG9883@rob-hp-laptop> Sender: linux-kernel-owner@vger.kernel.org To: Rob Herring Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org, pawel.moll@arm.com, mark.rutland@arm.com, ijc+devicetree@hellion.org.uk, galak@codeaurora.org, rogerq@ti.com, nsekhar@ti.com, linux-pci@vger.kernel.org, linux-usb@vger.kernel.org, tony@atomide.com, t-kristo@ti.com List-Id: devicetree@vger.kernel.org Hi On Sunday 20 December 2015 09:08 AM, Rob Herring wrote: > On Tue, Dec 15, 2015 at 02:46:05PM +0530, Kishon Vijay Abraham I wrote: >> Deprecate using phy-omap-control driver to power on/off the PHY and >> use *syscon* framework to do the same. >> >> Signed-off-by: Kishon Vijay Abraham I >> --- >> Documentation/devicetree/bindings/phy/ti-phy.txt | 10 ++- >> drivers/phy/phy-ti-pipe3.c | 90 ++++++++++++++++++---- >> 2 files changed, 85 insertions(+), 15 deletions(-) > > For the binding: > > Acked-by: Rob Herring > > One comment on the driver though. > > [...] > >> --- a/drivers/phy/phy-ti-pipe3.c >> +++ b/drivers/phy/phy-ti-pipe3.c > > [...] > >> @@ -144,18 +155,53 @@ static void ti_pipe3_disable_clocks(struct ti_pipe3 *phy); >> >> static int ti_pipe3_power_off(struct phy *x) >> { >> + u32 val; >> + int ret; >> struct ti_pipe3 *phy = phy_get_drvdata(x); >> >> - omap_control_phy_power(phy->control_dev, 0); >> + if (phy->phy_power_syscon) { > > Writing this as: > > if (!phy->phy_power_syscon) { > ... > return 0; > } > > //regmap code > > > will make it simpler to remove the deprecated code later. hmm.. I will make this change in all the applicable patches. Thanks Kishon > > >> + val = PIPE3_PHY_TX_RX_POWEROFF << >> + PIPE3_PHY_PWRCTL_CLK_CMD_SHIFT; >> + >> + ret = regmap_update_bits(phy->phy_power_syscon, phy->power_reg, >> + PIPE3_PHY_PWRCTL_CLK_CMD_MASK, val); >> + if (ret < 0) >> + return ret; >> + } else { >> + omap_control_phy_power(phy->control_dev, 0); >> + } >> >> return 0;