From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762270AbbA3NDk (ORCPT ); Fri, 30 Jan 2015 08:03:40 -0500 Received: from bhuna.collabora.co.uk ([93.93.135.160]:48654 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755926AbbA3NDi (ORCPT ); Fri, 30 Jan 2015 08:03:38 -0500 Message-ID: <54CB8125.7030107@collabora.co.uk> Date: Fri, 30 Jan 2015 14:03:33 +0100 From: Javier Martinez Canillas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.2.0 MIME-Version: 1.0 To: Ulf Hansson CC: Kukjin Kim , Doug Anderson , Olof Johansson , Arend van Spriel , Srinivas Kandagatla , linux-samsung-soc , "linux-arm-kernel@lists.infradead.org" , linux-mmc , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v3 4/6] mmc: pwrseq_simple: Add optional reference clock support References: <1422543608-24704-1-git-send-email-javier.martinez@collabora.co.uk> <1422543608-24704-5-git-send-email-javier.martinez@collabora.co.uk> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Ulf, On 01/30/2015 12:17 PM, Ulf Hansson wrote: >> }; >> @@ -39,6 +42,11 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) >> struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> struct mmc_pwrseq_simple, pwrseq); >> >> + if (!IS_ERR(pwrseq->ext_clk)) { > > This should be: > > if (!IS_ERR(pwrseq->ext_clk) && !pwrseq->clk_enabled) { > > Oh, I thought that it was not possible to enter mmc_pwrseq_pre_power_on() twice without a prior call to mmc_pwrseq_power_off() but I guess I didn't read the MMC core code carefully... >> + clk_prepare_enable(pwrseq->ext_clk); >> + pwrseq->clk_enabled = true; >> + } >> + >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> } >> >> @@ -50,6 +58,19 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 0); >> } >> >> +static void mmc_pwrseq_simple_power_off(struct mmc_host *host) >> +{ >> + struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> + struct mmc_pwrseq_simple, pwrseq); >> + >> + mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> + >> + if (pwrseq->clk_enabled) { > > I changed this as well, but that was just to make code clearer. > > if (!IS_ERR(pwrseq->ext_clk) && pwrseq->clk_enabled) { > > Yeah, if IS_ERR(pwrseq->ext_clk) then clk_enabled will always be false but I agree that the change makes the code to be more consistent. >> > > As I stated in the response to he coverletter for the patchset, this > patch is applied for next with above changes. > > Thanks! > Thanks a lot for your help and for fixing these things! > Kind regards > Uffe > Best regards, Javier From mboxrd@z Thu Jan 1 00:00:00 1970 From: Javier Martinez Canillas Subject: Re: [PATCH v3 4/6] mmc: pwrseq_simple: Add optional reference clock support Date: Fri, 30 Jan 2015 14:03:33 +0100 Message-ID: <54CB8125.7030107@collabora.co.uk> References: <1422543608-24704-1-git-send-email-javier.martinez@collabora.co.uk> <1422543608-24704-5-git-send-email-javier.martinez@collabora.co.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Ulf Hansson Cc: Kukjin Kim , Doug Anderson , Olof Johansson , Arend van Spriel , Srinivas Kandagatla , linux-samsung-soc , "linux-arm-kernel@lists.infradead.org" , linux-mmc , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" List-Id: devicetree@vger.kernel.org Hello Ulf, On 01/30/2015 12:17 PM, Ulf Hansson wrote: >> }; >> @@ -39,6 +42,11 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) >> struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> struct mmc_pwrseq_simple, pwrseq); >> >> + if (!IS_ERR(pwrseq->ext_clk)) { > > This should be: > > if (!IS_ERR(pwrseq->ext_clk) && !pwrseq->clk_enabled) { > > Oh, I thought that it was not possible to enter mmc_pwrseq_pre_power_on() twice without a prior call to mmc_pwrseq_power_off() but I guess I didn't read the MMC core code carefully... >> + clk_prepare_enable(pwrseq->ext_clk); >> + pwrseq->clk_enabled = true; >> + } >> + >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> } >> >> @@ -50,6 +58,19 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 0); >> } >> >> +static void mmc_pwrseq_simple_power_off(struct mmc_host *host) >> +{ >> + struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> + struct mmc_pwrseq_simple, pwrseq); >> + >> + mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> + >> + if (pwrseq->clk_enabled) { > > I changed this as well, but that was just to make code clearer. > > if (!IS_ERR(pwrseq->ext_clk) && pwrseq->clk_enabled) { > > Yeah, if IS_ERR(pwrseq->ext_clk) then clk_enabled will always be false but I agree that the change makes the code to be more consistent. >> > > As I stated in the response to he coverletter for the patchset, this > patch is applied for next with above changes. > > Thanks! > Thanks a lot for your help and for fixing these things! > Kind regards > Uffe > Best regards, Javier From mboxrd@z Thu Jan 1 00:00:00 1970 From: javier.martinez@collabora.co.uk (Javier Martinez Canillas) Date: Fri, 30 Jan 2015 14:03:33 +0100 Subject: [PATCH v3 4/6] mmc: pwrseq_simple: Add optional reference clock support In-Reply-To: References: <1422543608-24704-1-git-send-email-javier.martinez@collabora.co.uk> <1422543608-24704-5-git-send-email-javier.martinez@collabora.co.uk> Message-ID: <54CB8125.7030107@collabora.co.uk> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hello Ulf, On 01/30/2015 12:17 PM, Ulf Hansson wrote: >> }; >> @@ -39,6 +42,11 @@ static void mmc_pwrseq_simple_pre_power_on(struct mmc_host *host) >> struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> struct mmc_pwrseq_simple, pwrseq); >> >> + if (!IS_ERR(pwrseq->ext_clk)) { > > This should be: > > if (!IS_ERR(pwrseq->ext_clk) && !pwrseq->clk_enabled) { > > Oh, I thought that it was not possible to enter mmc_pwrseq_pre_power_on() twice without a prior call to mmc_pwrseq_power_off() but I guess I didn't read the MMC core code carefully... >> + clk_prepare_enable(pwrseq->ext_clk); >> + pwrseq->clk_enabled = true; >> + } >> + >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> } >> >> @@ -50,6 +58,19 @@ static void mmc_pwrseq_simple_post_power_on(struct mmc_host *host) >> mmc_pwrseq_simple_set_gpios_value(pwrseq, 0); >> } >> >> +static void mmc_pwrseq_simple_power_off(struct mmc_host *host) >> +{ >> + struct mmc_pwrseq_simple *pwrseq = container_of(host->pwrseq, >> + struct mmc_pwrseq_simple, pwrseq); >> + >> + mmc_pwrseq_simple_set_gpios_value(pwrseq, 1); >> + >> + if (pwrseq->clk_enabled) { > > I changed this as well, but that was just to make code clearer. > > if (!IS_ERR(pwrseq->ext_clk) && pwrseq->clk_enabled) { > > Yeah, if IS_ERR(pwrseq->ext_clk) then clk_enabled will always be false but I agree that the change makes the code to be more consistent. >> > > As I stated in the response to he coverletter for the patchset, this > patch is applied for next with above changes. > > Thanks! > Thanks a lot for your help and for fixing these things! > Kind regards > Uffe > Best regards, Javier