@@ -271,9 +271,7 @@ static irqreturn_t ast2600_timer_interrupt(int irq, void *dev_id)
271
271
}
272
272
273
273
static int __init fttmr010_common_init (struct device_node * np ,
274
- bool is_aspeed ,
275
- int (* timer_shutdown )(struct clock_event_device * ),
276
- irq_handler_t irq_handler )
274
+ bool is_aspeed , bool is_ast2600 )
277
275
{
278
276
struct fttmr010 * fttmr010 ;
279
277
int irq ;
@@ -374,17 +372,25 @@ static int __init fttmr010_common_init(struct device_node *np,
374
372
fttmr010 -> tick_rate );
375
373
}
376
374
377
- fttmr010 -> timer_shutdown = timer_shutdown ;
378
-
379
375
/*
380
376
* Setup clockevent timer (interrupt-driven) on timer 1.
381
377
*/
382
378
writel (0 , fttmr010 -> base + TIMER1_COUNT );
383
379
writel (0 , fttmr010 -> base + TIMER1_LOAD );
384
380
writel (0 , fttmr010 -> base + TIMER1_MATCH1 );
385
381
writel (0 , fttmr010 -> base + TIMER1_MATCH2 );
386
- ret = request_irq (irq , irq_handler , IRQF_TIMER ,
387
- "FTTMR010-TIMER1" , & fttmr010 -> clkevt );
382
+
383
+ if (is_ast2600 ) {
384
+ fttmr010 -> timer_shutdown = ast2600_timer_shutdown ;
385
+ ret = request_irq (irq , ast2600_timer_interrupt ,
386
+ IRQF_TIMER , "FTTMR010-TIMER1" ,
387
+ & fttmr010 -> clkevt );
388
+ } else {
389
+ fttmr010 -> timer_shutdown = fttmr010_timer_shutdown ;
390
+ ret = request_irq (irq , fttmr010_timer_interrupt ,
391
+ IRQF_TIMER , "FTTMR010-TIMER1" ,
392
+ & fttmr010 -> clkevt );
393
+ }
388
394
if (ret ) {
389
395
pr_err ("FTTMR010-TIMER1 no IRQ\n" );
390
396
goto out_unmap ;
@@ -432,23 +438,17 @@ static int __init fttmr010_common_init(struct device_node *np,
432
438
433
439
static __init int ast2600_timer_init (struct device_node * np )
434
440
{
435
- return fttmr010_common_init (np , true,
436
- ast2600_timer_shutdown ,
437
- ast2600_timer_interrupt );
441
+ return fttmr010_common_init (np , true, true);
438
442
}
439
443
440
444
static __init int aspeed_timer_init (struct device_node * np )
441
445
{
442
- return fttmr010_common_init (np , true,
443
- fttmr010_timer_shutdown ,
444
- fttmr010_timer_interrupt );
446
+ return fttmr010_common_init (np , true, false);
445
447
}
446
448
447
449
static __init int fttmr010_timer_init (struct device_node * np )
448
450
{
449
- return fttmr010_common_init (np , false,
450
- fttmr010_timer_shutdown ,
451
- fttmr010_timer_interrupt );
451
+ return fttmr010_common_init (np , false, false);
452
452
}
453
453
454
454
TIMER_OF_DECLARE (fttmr010 , "faraday,fttmr010" , fttmr010_timer_init );
0 commit comments