Commit a0143f5a authored by Krzysztof Kozlowski's avatar Krzysztof Kozlowski Committed by Daniel Lezcano

clocksource/drivers/samsung_pwm: Minor whitespace cleanup

Cleanup the code to be slightly more readable and follow coding
convention - only whitespace.  This fixes checkpatch warnings:

  WARNING: Block comments should align the * on each line
  WARNING: please, no space before tabs
  WARNING: Missing a blank line after declarations
  CHECK: Alignment should match open parenthesis
Signed-off-by: default avatarKrzysztof Kozlowski <krzysztof.kozlowski@canonical.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210506202729.157260-1-krzysztof.kozlowski@canonical.com
parent 4f9f4f0f
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
* http://www.samsung.com/ * http://www.samsung.com/
* *
* samsung - Common hr-timer support (s3c and s5p) * samsung - Common hr-timer support (s3c and s5p)
*/ */
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/irq.h> #include <linux/irq.h>
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
#include <clocksource/samsung_pwm.h> #include <clocksource/samsung_pwm.h>
/* /*
* Clocksource driver * Clocksource driver
*/ */
...@@ -38,8 +37,8 @@ ...@@ -38,8 +37,8 @@
#define TCFG0_PRESCALER_MASK 0xff #define TCFG0_PRESCALER_MASK 0xff
#define TCFG0_PRESCALER1_SHIFT 8 #define TCFG0_PRESCALER1_SHIFT 8
#define TCFG1_SHIFT(x) ((x) * 4) #define TCFG1_SHIFT(x) ((x) * 4)
#define TCFG1_MUX_MASK 0xf #define TCFG1_MUX_MASK 0xf
/* /*
* Each channel occupies 4 bits in TCON register, but there is a gap of 4 * Each channel occupies 4 bits in TCON register, but there is a gap of 4
...@@ -183,7 +182,7 @@ static void samsung_time_start(unsigned int channel, bool periodic) ...@@ -183,7 +182,7 @@ static void samsung_time_start(unsigned int channel, bool periodic)
} }
static int samsung_set_next_event(unsigned long cycles, static int samsung_set_next_event(unsigned long cycles,
struct clock_event_device *evt) struct clock_event_device *evt)
{ {
/* /*
* This check is needed to account for internal rounding * This check is needed to account for internal rounding
...@@ -225,6 +224,7 @@ static void samsung_clockevent_resume(struct clock_event_device *cev) ...@@ -225,6 +224,7 @@ static void samsung_clockevent_resume(struct clock_event_device *cev)
if (pwm.variant.has_tint_cstat) { if (pwm.variant.has_tint_cstat) {
u32 mask = (1 << pwm.event_id); u32 mask = (1 << pwm.event_id);
writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT); writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT);
} }
} }
...@@ -248,6 +248,7 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id) ...@@ -248,6 +248,7 @@ static irqreturn_t samsung_clock_event_isr(int irq, void *dev_id)
if (pwm.variant.has_tint_cstat) { if (pwm.variant.has_tint_cstat) {
u32 mask = (1 << pwm.event_id); u32 mask = (1 << pwm.event_id);
writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT); writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT);
} }
...@@ -272,7 +273,7 @@ static void __init samsung_clockevent_init(void) ...@@ -272,7 +273,7 @@ static void __init samsung_clockevent_init(void)
time_event_device.cpumask = cpumask_of(0); time_event_device.cpumask = cpumask_of(0);
clockevents_config_and_register(&time_event_device, clockevents_config_and_register(&time_event_device,
clock_rate, 1, pwm.tcnt_max); clock_rate, 1, pwm.tcnt_max);
irq_number = pwm.irq[pwm.event_id]; irq_number = pwm.irq[pwm.event_id];
if (request_irq(irq_number, samsung_clock_event_isr, if (request_irq(irq_number, samsung_clock_event_isr,
...@@ -282,6 +283,7 @@ static void __init samsung_clockevent_init(void) ...@@ -282,6 +283,7 @@ static void __init samsung_clockevent_init(void)
if (pwm.variant.has_tint_cstat) { if (pwm.variant.has_tint_cstat) {
u32 mask = (1 << pwm.event_id); u32 mask = (1 << pwm.event_id);
writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT); writel(mask | (mask << 5), pwm.base + REG_TINT_CSTAT);
} }
} }
...@@ -347,7 +349,7 @@ static int __init samsung_clocksource_init(void) ...@@ -347,7 +349,7 @@ static int __init samsung_clocksource_init(void)
pwm.source_reg = pwm.base + pwm.source_id * 0x0c + 0x14; pwm.source_reg = pwm.base + pwm.source_id * 0x0c + 0x14;
sched_clock_register(samsung_read_sched_clock, sched_clock_register(samsung_read_sched_clock,
pwm.variant.bits, clock_rate); pwm.variant.bits, clock_rate);
samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits); samsung_clocksource.mask = CLOCKSOURCE_MASK(pwm.variant.bits);
return clocksource_register_hz(&samsung_clocksource, clock_rate); return clocksource_register_hz(&samsung_clocksource, clock_rate);
...@@ -398,7 +400,8 @@ static int __init _samsung_pwm_clocksource_init(void) ...@@ -398,7 +400,8 @@ static int __init _samsung_pwm_clocksource_init(void)
} }
void __init samsung_pwm_clocksource_init(void __iomem *base, void __init samsung_pwm_clocksource_init(void __iomem *base,
unsigned int *irqs, struct samsung_pwm_variant *variant) unsigned int *irqs,
struct samsung_pwm_variant *variant)
{ {
pwm.base = base; pwm.base = base;
memcpy(&pwm.variant, variant, sizeof(pwm.variant)); memcpy(&pwm.variant, variant, sizeof(pwm.variant));
......
...@@ -27,6 +27,7 @@ struct samsung_pwm_variant { ...@@ -27,6 +27,7 @@ struct samsung_pwm_variant {
}; };
void samsung_pwm_clocksource_init(void __iomem *base, void samsung_pwm_clocksource_init(void __iomem *base,
unsigned int *irqs, struct samsung_pwm_variant *variant); unsigned int *irqs,
struct samsung_pwm_variant *variant);
#endif /* __CLOCKSOURCE_SAMSUNG_PWM_H */ #endif /* __CLOCKSOURCE_SAMSUNG_PWM_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment