From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750988AbdE2GGF (ORCPT ); Mon, 29 May 2017 02:06:05 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:34467 "EHLO out1-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750871AbdE2GGD (ORCPT ); Mon, 29 May 2017 02:06:03 -0400 X-ME-Sender: X-Sasl-enc: TOWBmKy7YAnk4aYynhxrh2CUSeVAbyNjHuggWQMcNq+J 1496037962 Message-ID: <1496037951.8159.0.camel@aj.id.au> Subject: Re: [PATCH] clocksource/drivers/fttmr010: Fix aspeed-2500 initialization From: Andrew Jeffery To: Daniel Lezcano Cc: joel@jms.id.au, ryan_chen@aspeedtech.com, mark.rutland@arm.com, linus.walleij@linaro.org, jonas.jensen@gmail.com, Thomas Gleixner , "open list:CLOCKSOURCE, CLOCKEVENT DRIVERS" Date: Mon, 29 May 2017 15:35:51 +0930 In-Reply-To: <1495788523-26051-1-git-send-email-daniel.lezcano@linaro.org> References: <1495761138.7794.11.camel@aj.id.au> <1495788523-26051-1-git-send-email-daniel.lezcano@linaro.org> Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-IE3ZSF6Hqx+I7fQuIjtU" X-Mailer: Evolution 3.22.6-1ubuntu1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-IE3ZSF6Hqx+I7fQuIjtU Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, 2017-05-26 at 10:48 +0200, Daniel Lezcano wrote: > The recent changes made the fttmr010 to be more generic and support diffe= rent > timers with a very few differences like moxart or aspeed. >=20 > The aspeed timer uses a countdown and there is a test against the aspeed2= 400 > compatible string to set a flag. >=20 > With the previous patch, we added the aspeed2500 compatible string but wi= thout > taking care of setting the countdown flag. >=20 > Fix this by specifiying a init function and pass the aspeed flag to a com= mon > init function. >=20 > Signed-off-by: Daniel Lezcano Tested-by: Andrew Jeffery Reviewed-by: Andrew Jeffery > --- > =C2=A0drivers/clocksource/timer-fttmr010.c | 23 ++++++++++++++++------- > =C2=A01 file changed, 16 insertions(+), 7 deletions(-) >=20 > diff --git a/drivers/clocksource/timer-fttmr010.c b/drivers/clocksource/t= imer-fttmr010.c > index 68982ad..d96190e 100644 > --- a/drivers/clocksource/timer-fttmr010.c > +++ b/drivers/clocksource/timer-fttmr010.c > @@ -210,10 +210,9 @@ static irqreturn_t fttmr010_timer_interrupt(int irq,= void *dev_id) > > =C2=A0 return IRQ_HANDLED; > =C2=A0} > =C2=A0 > -static int __init fttmr010_timer_init(struct device_node *np) > +static int __init fttmr010_common_init(struct device_node *np, bool is_a= speed) > =C2=A0{ > > =C2=A0 struct fttmr010 *fttmr010; > > - bool is_ast2400; > > =C2=A0 int irq; > > =C2=A0 struct clk *clk; > > =C2=A0 int ret; > @@ -260,8 +259,7 @@ static int __init fttmr010_timer_init(struct device_n= ode *np) > > =C2=A0 =C2=A0* The Aspeed AST2400 moves bits around in the control regi= ster, > > =C2=A0 =C2=A0* otherwise it works the same. > > =C2=A0 =C2=A0*/ > > - is_ast2400 =3D of_device_is_compatible(np, "aspeed,ast2400-timer"); > > - if (is_ast2400) { > > + if (is_aspeed) { > > =C2=A0 fttmr010->t1_enable_val =3D TIMER_1_CR_ASPEED_ENABLE | > > =C2=A0 TIMER_1_CR_ASPEED_INT; > > =C2=A0 /* Downward not available */ > @@ -280,7 +278,7 @@ static int __init fttmr010_timer_init(struct device_n= ode *np) > > =C2=A0 =C2=A0* Enable timer 1 count up, timer 2 count up, except on Asp= eed, > > =C2=A0 =C2=A0* where everything just counts down. > > =C2=A0 =C2=A0*/ > > - if (is_ast2400) > > + if (is_aspeed) > > =C2=A0 val =3D TIMER_2_CR_ASPEED_ENABLE; > > =C2=A0 else { > > =C2=A0 val =3D TIMER_2_CR_ENABLE; > @@ -355,8 +353,19 @@ static int __init fttmr010_timer_init(struct device_= node *np) > =C2=A0 > > =C2=A0 return ret; > =C2=A0} > + > +static __init int aspeed_timer_init(struct device_node *np) > +{ > > + return fttmr010_common_init(np, true); > +} > + > +static __init int fttmr010_timer_init(struct device_node *np) > +{ > > + return fttmr010_common_init(np, false); > +} > + > =C2=A0CLOCKSOURCE_OF_DECLARE(fttmr010, "faraday,fttmr010", fttmr010_timer= _init); > =C2=A0CLOCKSOURCE_OF_DECLARE(gemini, "cortina,gemini-timer", fttmr010_tim= er_init); > =C2=A0CLOCKSOURCE_OF_DECLARE(moxart, "moxa,moxart-timer", fttmr010_timer_= init); > -CLOCKSOURCE_OF_DECLARE(ast2400, "aspeed,ast2400-timer", fttmr010_timer_i= nit); > -CLOCKSOURCE_OF_DECLARE(ast2500, "aspeed,ast2500-timer", fttmr010_timer_i= nit); > +CLOCKSOURCE_OF_DECLARE(ast2400, "aspeed,ast2400-timer", aspeed_timer_ini= t); > +CLOCKSOURCE_OF_DECLARE(ast2500, "aspeed,ast2500-timer", aspeed_timer_ini= t); --=-IE3ZSF6Hqx+I7fQuIjtU Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQIcBAABCgAGBQJZK7o/AAoJEJ0dnzgO5LT5kvQP/AqtfrONfK/uyhYtU66dvCiU yC5Vub1MnNhfKlb9v//4DopcEpcI+zMa+Wx8+tsX8zK+ujAkzwFX9d750QExns0+ KB/9rHMdJWd5+vdKndOQeblyw5lKDFFac01OnfVbvgH3D0FXVsFLLUecpANP9Fsd g48pGdk+6bvSWSj28Js+9VWuuOFxFfsAFkqEbHwUQmmImqU1o2EBoKsQ53oToWEG Odvfp8Q/9NjT118yZMhpRnpnfIje5arIgPUEFU66oZ/e9De+kc1JvZNoJBrbjoDC MNS4CRquH+F8cmexZMAKLA6q4Qo7bvPevCGsDSP7KXOf30q75fPdQ4+XK04eolVU +A+I+W5N4DkzefKjyCHAKxxAnX3JfEXxKwsZt8E/5FGjQxvS6lrvmfVQwmZNOkc1 V+fENWRroiNogNgFRteMRgnTYvIFCfrAY6uYoWDQderSQ5pTH3kaGstvm/6HxAkx +/Vu3fd23XjWuexikjRHGufsbtVneNlR0mow0LsXNV9iKHSpGDiysZVr0Cth/D4z vo1v5dg1lUmg+aSVBcVUASnclHbLErd/ev6l8/A9ki82HC67M/XDWhF+LrUmCBfq y/48RLex//RYclhnuRIZzRALN9viW9kolhiDFljouGLw0O5RhySE2FLNq5RX7D7w Wu/dfLEalOeY5jnVLn+Z =cRP7 -----END PGP SIGNATURE----- --=-IE3ZSF6Hqx+I7fQuIjtU--