[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20150323144851.GL24804@x1>
Date: Mon, 23 Mar 2015 14:48:51 +0000
From: Lee Jones <lee.jones@...aro.org>
To: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
Cc: broonie@...nel.org, sameo@...ux.intel.com, lgirdwood@...il.com,
patches@...nsource.wolfsonmicro.com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 1/4] mfd: arizona: Factor out SYSCLK enable from
wm5102 hardware patch
On Mon, 23 Mar 2015, Charles Keepax wrote:
> On Mon, Mar 23, 2015 at 01:52:13PM +0000, Lee Jones wrote:
> > On Tue, 17 Mar 2015, Charles Keepax wrote:
> >
> > > wm5102 applies a custom hardware boot sequence, for this the SYSCLK
> > > needs to be enabled. This patch factors out the code that enables
> > > SYSCLK for this sequence such that it can be used for other boot time
> > > operations that require SYSCLK.
> > >
> > > Signed-off-by: Charles Keepax <ckeepax@...nsource.wolfsonmicro.com>
> > > ---
> <snip>
> > > +
> > > +static inline int arizona_apply_hardware_patch(struct arizona *arizona)
> > > +{
> > > + return arizona_exec_with_sysclk(arizona, arizona_hardware_patch_wseq);
> >
> > Not sure I like this much.
> >
> > What's the reason for over-complicating this? Can you just:
> >
> > arizona_exec_with_sysclk(arizona);
> > arizona_hardware_patch_wseq(arizona);
> >
> > ... or if you need that call to be in the middle, split the calls up
> > further.
> >
>
> Yeah, it was just a handy way to store the state and keep the
> amount of code down. But I don't really have any problem with
> explicitly storing the state if you prefer that.
>
> So would probably look something like:
>
> struct sysclk_state;
> int ret;
>
> ret = arizona_force_sysclk(arizona, &sysclk_state);
> if (ret) {
> //Handle error
> }
> ret = arizona_hardware_patch_wseq(arizona);
> if (ret) {
> //Handle error
> }
> ret = arizona_restore_sysclk(arizona, &sysclk_state);
> if (ret) {
> //Handle error
> }
>
> I will assume you want it updated to look like this so let me
> know if not.
Looks much cleaner/less hacky.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists