mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-22 02:17:36 -04:00
Merge branch into tip/master: 'timers/clocksource'
# New commits in timers/clocksource:
68ed094971 ("clocksource/drivers/timer-of: Make the code compatible with modules")
2423405880 ("clocksource/drivers/mmio: Make the code compatible with modules")
fed9f727cc ("clocksource/drivers/sun5i: Handle error returns from devm_reset_control_get_optional_exclusive()")
045a9dac7e ("clocksource/drivers/timer-rtl-otto: Make rttm_cs variable static")
b385caf918 ("dt-bindings: timer: fsl,imxgpt: add compatible string fsl,imx25-epit")
Signed-off-by: Ingo Molnar <mingo@kernel.org>
This commit is contained in:
@@ -14,6 +14,7 @@ properties:
|
||||
oneOf:
|
||||
- const: fsl,imx1-gpt
|
||||
- const: fsl,imx21-gpt
|
||||
- const: fsl,imx25-epit
|
||||
- items:
|
||||
- const: fsl,imx27-gpt
|
||||
- const: fsl,imx21-gpt
|
||||
|
||||
@@ -21,21 +21,25 @@ u64 clocksource_mmio_readl_up(struct clocksource *c)
|
||||
{
|
||||
return (u64)readl_relaxed(to_mmio_clksrc(c)->reg);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clocksource_mmio_readl_up);
|
||||
|
||||
u64 clocksource_mmio_readl_down(struct clocksource *c)
|
||||
{
|
||||
return ~(u64)readl_relaxed(to_mmio_clksrc(c)->reg) & c->mask;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clocksource_mmio_readl_down);
|
||||
|
||||
u64 clocksource_mmio_readw_up(struct clocksource *c)
|
||||
{
|
||||
return (u64)readw_relaxed(to_mmio_clksrc(c)->reg);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clocksource_mmio_readw_up);
|
||||
|
||||
u64 clocksource_mmio_readw_down(struct clocksource *c)
|
||||
{
|
||||
return ~(u64)readw_relaxed(to_mmio_clksrc(c)->reg) & c->mask;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clocksource_mmio_readw_down);
|
||||
|
||||
/**
|
||||
* clocksource_mmio_init - Initialize a simple mmio based clocksource
|
||||
@@ -46,9 +50,9 @@ u64 clocksource_mmio_readw_down(struct clocksource *c)
|
||||
* @bits: Number of valid bits
|
||||
* @read: One of clocksource_mmio_read*() above
|
||||
*/
|
||||
int __init clocksource_mmio_init(void __iomem *base, const char *name,
|
||||
unsigned long hz, int rating, unsigned bits,
|
||||
u64 (*read)(struct clocksource *))
|
||||
int clocksource_mmio_init(void __iomem *base, const char *name,
|
||||
unsigned long hz, int rating, unsigned bits,
|
||||
u64 (*read)(struct clocksource *))
|
||||
{
|
||||
struct clocksource_mmio *cs;
|
||||
|
||||
@@ -68,3 +72,4 @@ int __init clocksource_mmio_init(void __iomem *base, const char *name,
|
||||
|
||||
return clocksource_register_hz(&cs->clksrc, hz);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(clocksource_mmio_init);
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
*
|
||||
* Free the irq resource
|
||||
*/
|
||||
static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
||||
static void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
||||
{
|
||||
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
||||
|
||||
@@ -41,8 +41,8 @@ static __init void timer_of_irq_exit(struct of_timer_irq *of_irq)
|
||||
*
|
||||
* Returns 0 on success, < 0 otherwise
|
||||
*/
|
||||
static __init int timer_of_irq_init(struct device_node *np,
|
||||
struct of_timer_irq *of_irq)
|
||||
static int timer_of_irq_init(struct device_node *np,
|
||||
struct of_timer_irq *of_irq)
|
||||
{
|
||||
int ret;
|
||||
struct timer_of *to = container_of(of_irq, struct timer_of, of_irq);
|
||||
@@ -82,7 +82,7 @@ static __init int timer_of_irq_init(struct device_node *np,
|
||||
*
|
||||
* Disables and releases the refcount on the clk
|
||||
*/
|
||||
static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
||||
static void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
||||
{
|
||||
of_clk->rate = 0;
|
||||
clk_disable_unprepare(of_clk->clk);
|
||||
@@ -98,8 +98,8 @@ static __init void timer_of_clk_exit(struct of_timer_clk *of_clk)
|
||||
*
|
||||
* Returns 0 on success, < 0 otherwise
|
||||
*/
|
||||
static __init int timer_of_clk_init(struct device_node *np,
|
||||
struct of_timer_clk *of_clk)
|
||||
static int timer_of_clk_init(struct device_node *np,
|
||||
struct of_timer_clk *of_clk)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -137,13 +137,13 @@ static __init int timer_of_clk_init(struct device_node *np,
|
||||
goto out;
|
||||
}
|
||||
|
||||
static __init void timer_of_base_exit(struct of_timer_base *of_base)
|
||||
static void timer_of_base_exit(struct of_timer_base *of_base)
|
||||
{
|
||||
iounmap(of_base->base);
|
||||
}
|
||||
|
||||
static __init int timer_of_base_init(struct device_node *np,
|
||||
struct of_timer_base *of_base)
|
||||
static int timer_of_base_init(struct device_node *np,
|
||||
struct of_timer_base *of_base)
|
||||
{
|
||||
of_base->base = of_base->name ?
|
||||
of_io_request_and_map(np, of_base->index, of_base->name) :
|
||||
@@ -156,7 +156,7 @@ static __init int timer_of_base_init(struct device_node *np,
|
||||
return 0;
|
||||
}
|
||||
|
||||
int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
||||
int timer_of_init(struct device_node *np, struct timer_of *to)
|
||||
{
|
||||
int ret = -EINVAL;
|
||||
int flags = 0;
|
||||
@@ -200,6 +200,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
||||
timer_of_base_exit(&to->of_base);
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(timer_of_init);
|
||||
|
||||
/**
|
||||
* timer_of_cleanup - release timer_of resources
|
||||
@@ -208,7 +209,7 @@ int __init timer_of_init(struct device_node *np, struct timer_of *to)
|
||||
* Release the resources that has been used in timer_of_init().
|
||||
* This function should be called in init error cases
|
||||
*/
|
||||
void __init timer_of_cleanup(struct timer_of *to)
|
||||
void timer_of_cleanup(struct timer_of *to)
|
||||
{
|
||||
if (to->flags & TIMER_OF_IRQ)
|
||||
timer_of_irq_exit(&to->of_irq);
|
||||
@@ -219,3 +220,4 @@ void __init timer_of_cleanup(struct timer_of *to)
|
||||
if (to->flags & TIMER_OF_BASE)
|
||||
timer_of_base_exit(&to->of_base);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(timer_of_cleanup);
|
||||
|
||||
@@ -65,9 +65,8 @@ static inline unsigned long timer_of_period(struct timer_of *to)
|
||||
return to->of_clk.period;
|
||||
}
|
||||
|
||||
extern int __init timer_of_init(struct device_node *np,
|
||||
struct timer_of *to);
|
||||
int timer_of_init(struct device_node *np, struct timer_of *to);
|
||||
|
||||
extern void __init timer_of_cleanup(struct timer_of *to);
|
||||
void timer_of_cleanup(struct timer_of *to);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -225,7 +225,7 @@ static int rttm_enable_clocksource(struct clocksource *cs)
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct rttm_cs rttm_cs = {
|
||||
static struct rttm_cs rttm_cs = {
|
||||
.to = {
|
||||
.flags = TIMER_OF_BASE | TIMER_OF_CLOCK,
|
||||
},
|
||||
|
||||
@@ -286,6 +286,9 @@ static int sun5i_timer_probe(struct platform_device *pdev)
|
||||
}
|
||||
|
||||
rstc = devm_reset_control_get_optional_exclusive(dev, NULL);
|
||||
if (IS_ERR(rstc))
|
||||
return dev_err_probe(dev, PTR_ERR(rstc),
|
||||
"failed to get reset\n");
|
||||
if (rstc)
|
||||
reset_control_deassert(rstc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user