mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-08 07:21:27 +00:00
clocksource: sh_tmu: Hardcode TMU clock event and source ratings to 200
All boards use clock event and clock source ratings of 200 for the TMU, hardcode it in the driver. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
This commit is contained in:
parent
5cfe2d151f
commit
f1010ed1a1
1 changed files with 11 additions and 12 deletions
|
@ -300,12 +300,12 @@ static void sh_tmu_clocksource_resume(struct clocksource *cs)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch,
|
static int sh_tmu_register_clocksource(struct sh_tmu_channel *ch,
|
||||||
const char *name, unsigned long rating)
|
const char *name)
|
||||||
{
|
{
|
||||||
struct clocksource *cs = &ch->cs;
|
struct clocksource *cs = &ch->cs;
|
||||||
|
|
||||||
cs->name = name;
|
cs->name = name;
|
||||||
cs->rating = rating;
|
cs->rating = 200;
|
||||||
cs->read = sh_tmu_clocksource_read;
|
cs->read = sh_tmu_clocksource_read;
|
||||||
cs->enable = sh_tmu_clocksource_enable;
|
cs->enable = sh_tmu_clocksource_enable;
|
||||||
cs->disable = sh_tmu_clocksource_disable;
|
cs->disable = sh_tmu_clocksource_disable;
|
||||||
|
@ -402,7 +402,7 @@ static void sh_tmu_clock_event_resume(struct clock_event_device *ced)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
|
static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
|
||||||
const char *name, unsigned long rating)
|
const char *name)
|
||||||
{
|
{
|
||||||
struct clock_event_device *ced = &ch->ced;
|
struct clock_event_device *ced = &ch->ced;
|
||||||
int ret;
|
int ret;
|
||||||
|
@ -410,7 +410,7 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
|
||||||
ced->name = name;
|
ced->name = name;
|
||||||
ced->features = CLOCK_EVT_FEAT_PERIODIC;
|
ced->features = CLOCK_EVT_FEAT_PERIODIC;
|
||||||
ced->features |= CLOCK_EVT_FEAT_ONESHOT;
|
ced->features |= CLOCK_EVT_FEAT_ONESHOT;
|
||||||
ced->rating = rating;
|
ced->rating = 200;
|
||||||
ced->cpumask = cpumask_of(0);
|
ced->cpumask = cpumask_of(0);
|
||||||
ced->set_next_event = sh_tmu_clock_event_next;
|
ced->set_next_event = sh_tmu_clock_event_next;
|
||||||
ced->set_mode = sh_tmu_clock_event_mode;
|
ced->set_mode = sh_tmu_clock_event_mode;
|
||||||
|
@ -433,13 +433,12 @@ static void sh_tmu_register_clockevent(struct sh_tmu_channel *ch,
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name,
|
static int sh_tmu_register(struct sh_tmu_channel *ch, const char *name,
|
||||||
unsigned long clockevent_rating,
|
bool clockevent, bool clocksource)
|
||||||
unsigned long clocksource_rating)
|
|
||||||
{
|
{
|
||||||
if (clockevent_rating)
|
if (clockevent)
|
||||||
sh_tmu_register_clockevent(ch, name, clockevent_rating);
|
sh_tmu_register_clockevent(ch, name);
|
||||||
else if (clocksource_rating)
|
else if (clocksource)
|
||||||
sh_tmu_register_clocksource(ch, name, clocksource_rating);
|
sh_tmu_register_clocksource(ch, name);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -471,8 +470,8 @@ static int sh_tmu_channel_setup(struct sh_tmu_channel *ch,
|
||||||
ch->enable_count = 0;
|
ch->enable_count = 0;
|
||||||
|
|
||||||
return sh_tmu_register(ch, dev_name(&tmu->pdev->dev),
|
return sh_tmu_register(ch, dev_name(&tmu->pdev->dev),
|
||||||
cfg->clockevent_rating,
|
cfg->clockevent_rating != 0,
|
||||||
cfg->clocksource_rating);
|
cfg->clocksource_rating != 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
|
static int sh_tmu_setup(struct sh_tmu_device *tmu, struct platform_device *pdev)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue