diff mbox

input/joystick: use get_cycles on ARMv8

Message ID 1407771730-1641-1-git-send-email-broonie@kernel.org
State New
Headers show

Commit Message

Mark Brown Aug. 11, 2014, 3:42 p.m. UTC
From: Mark Brown <broonie@linaro.org>

As with ARM the ARMv8 architecture provides a cycle counter which can be
used to provide a high resolution time for the joystick driver and silence
the build warning that results from not having a precise timer on ARMv8,
making allmodconfig and allyesconfig quieter.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/input/joystick/analog.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Dmitry Torokhov Aug. 12, 2014, 5:01 p.m. UTC | #1
On Mon, Aug 11, 2014 at 04:42:10PM +0100, Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
> 
> As with ARM the ARMv8 architecture provides a cycle counter which can be
> used to provide a high resolution time for the joystick driver and silence
> the build warning that results from not having a precise timer on ARMv8,
> making allmodconfig and allyesconfig quieter.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>

Applied, although I wonder if it is time to retire whole gamecon subsystem. I
don't think there are many users left... 

> ---
>  drivers/input/joystick/analog.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
> index 9135606c8649..ab0fdcd36e18 100644
> --- a/drivers/input/joystick/analog.c
> +++ b/drivers/input/joystick/analog.c
> @@ -158,7 +158,7 @@ static unsigned int get_time_pit(void)
>  #define GET_TIME(x)	rdtscl(x)
>  #define DELTA(x,y)	((y)-(x))
>  #define TIME_NAME	"TSC"
> -#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_TILE)
> +#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_TILE)
>  #define GET_TIME(x)	do { x = get_cycles(); } while (0)
>  #define DELTA(x,y)	((y)-(x))
>  #define TIME_NAME	"get_cycles"
> -- 
> 2.0.1
>
Mark Brown Aug. 12, 2014, 5:36 p.m. UTC | #2
On Tue, Aug 12, 2014 at 10:01:49AM -0700, Dmitry Torokhov wrote:
> On Mon, Aug 11, 2014 at 04:42:10PM +0100, Mark Brown wrote:

> > As with ARM the ARMv8 architecture provides a cycle counter which can be
> > used to provide a high resolution time for the joystick driver and silence
> > the build warning that results from not having a precise timer on ARMv8,
> > making allmodconfig and allyesconfig quieter.

> Applied, although I wonder if it is time to retire whole gamecon subsystem. I
> don't think there are many users left... 

OTOH it doesn't really do much harm either, the rate of updates seems
pretty low.  I was wondering about converting the warning to a runtime
one - it'll probably be more likely to be seen by anyone who is using it
and makes for less of these porting issues but I couldn't quite find the
motivation.
diff mbox

Patch

diff --git a/drivers/input/joystick/analog.c b/drivers/input/joystick/analog.c
index 9135606c8649..ab0fdcd36e18 100644
--- a/drivers/input/joystick/analog.c
+++ b/drivers/input/joystick/analog.c
@@ -158,7 +158,7 @@  static unsigned int get_time_pit(void)
 #define GET_TIME(x)	rdtscl(x)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"TSC"
-#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_TILE)
+#elif defined(__alpha__) || defined(CONFIG_MN10300) || defined(CONFIG_ARM) || defined(CONFIG_ARM64) || defined(CONFIG_TILE)
 #define GET_TIME(x)	do { x = get_cycles(); } while (0)
 #define DELTA(x,y)	((y)-(x))
 #define TIME_NAME	"get_cycles"