From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Courbot Date: Fri, 19 Oct 2012 09:31:53 +0000 Subject: Re: [PATCH v7 2/3] pwm_backlight: use power sequences Message-Id: <2048338.SjS64CMeN7@percival> List-Id: References: <1350637589-7405-1-git-send-email-acourbot@nvidia.com> <1350637589-7405-3-git-send-email-acourbot@nvidia.com> <1350638436.3339.2.camel@gitbox> In-Reply-To: <1350638436.3339.2.camel@gitbox> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Tony Prisk Cc: Stephen Warren , Thierry Reding , Simon Glass , Grant Likely , Rob Herring , Mark Brown , Anton Vorontsov , David Woodhouse , Arnd Bergmann , "linux-fbdev@vger.kernel.org" , "linux-pm@vger.kernel.org" , Leela Krishna Amudala , "devicetree-discuss@lists.ozlabs.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" On Friday 19 October 2012 17:20:36 Tony Prisk wrote: > On Fri, 2012-10-19 at 18:06 +0900, Alexandre Courbot wrote: > > +static void pwm_backlight_on(struct backlight_device *bl) > > +{ > > + struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); > > + int ret; > > + > > + if (pb->enabled) > > + return; > > + > > + if (pb->power_on_seq) { > > + ret = power_seq_run(pb->power_on_seq); > > + if (ret < 0) { > > + dev_err(&bl->dev, "cannot run power on > > sequence\n"); > > + return; > > + } > > + } else { > > + /* legacy framework */ > > + pwm_config(pb->pwm, 0, pb->period); > > + pwm_disable(pb->pwm); > > Is this right? pwm_disable() in the backlight_on function? Now everybody will notice that I never really tested the legacy interface. >_< Thanks, this was totally wrong indeed. Alex. From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Courbot Subject: Re: [PATCH v7 2/3] pwm_backlight: use power sequences Date: Fri, 19 Oct 2012 18:31:53 +0900 Message-ID: <2048338.SjS64CMeN7@percival> References: <1350637589-7405-1-git-send-email-acourbot@nvidia.com> <1350637589-7405-3-git-send-email-acourbot@nvidia.com> <1350638436.3339.2.camel@gitbox> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Return-path: In-Reply-To: <1350638436.3339.2.camel@gitbox> Sender: linux-kernel-owner@vger.kernel.org To: Tony Prisk Cc: Stephen Warren , Thierry Reding , Simon Glass , Grant Likely , Rob Herring , Mark Brown , Anton Vorontsov , David Woodhouse , Arnd Bergmann , "linux-fbdev@vger.kernel.org" , "linux-pm@vger.kernel.org" , Leela Krishna Amudala , "devicetree-discuss@lists.ozlabs.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" List-Id: linux-tegra@vger.kernel.org On Friday 19 October 2012 17:20:36 Tony Prisk wrote: > On Fri, 2012-10-19 at 18:06 +0900, Alexandre Courbot wrote: > > +static void pwm_backlight_on(struct backlight_device *bl) > > +{ > > + struct pwm_bl_data *pb = dev_get_drvdata(&bl->dev); > > + int ret; > > + > > + if (pb->enabled) > > + return; > > + > > + if (pb->power_on_seq) { > > + ret = power_seq_run(pb->power_on_seq); > > + if (ret < 0) { > > + dev_err(&bl->dev, "cannot run power on > > sequence\n"); > > + return; > > + } > > + } else { > > + /* legacy framework */ > > + pwm_config(pb->pwm, 0, pb->period); > > + pwm_disable(pb->pwm); > > Is this right? pwm_disable() in the backlight_on function? Now everybody will notice that I never really tested the legacy interface. >_< Thanks, this was totally wrong indeed. Alex.