diff options
| author | Michal Simek <michal.simek@xilinx.com> | 2013-03-27 07:05:28 -0400 |
|---|---|---|
| committer | Michal Simek <michal.simek@xilinx.com> | 2013-04-04 03:22:02 -0400 |
| commit | 9e09dc5f7fdc1e914c3b7bc186fa4b54d05a88d6 (patch) | |
| tree | 183e73072ef8449a39a8ef74c1d23118a955ff8f | |
| parent | c5263bb8b7944f1e34b36b5ea8a9119fc48a31ae (diff) | |
arm: zynq: Do not use xilinx specific function names
Remove all xilinx specific names from the driver
because this is generic driver for cadence ttc.
xttc->ttc
ttcps->ttc
...
No functional changes in this driver.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
| -rw-r--r-- | arch/arm/mach-zynq/timer.c | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/arch/arm/mach-zynq/timer.c b/arch/arm/mach-zynq/timer.c index ab5b839e22f0..685bc60e210a 100644 --- a/arch/arm/mach-zynq/timer.c +++ b/arch/arm/mach-zynq/timer.c | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * This file contains driver for the Xilinx PS Timer Counter IP. | 2 | * This file contains driver for the Cadence Triple Timer Counter Rev 06 |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2011-2013 Xilinx | 4 | * Copyright (C) 2011-2013 Xilinx |
| 5 | * | 5 | * |
| @@ -42,14 +42,14 @@ | |||
| 42 | * Timer Register Offset Definitions of Timer 1, Increment base address by 4 | 42 | * Timer Register Offset Definitions of Timer 1, Increment base address by 4 |
| 43 | * and use same offsets for Timer 2 | 43 | * and use same offsets for Timer 2 |
| 44 | */ | 44 | */ |
| 45 | #define XTTCPS_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ | 45 | #define TTC_CLK_CNTRL_OFFSET 0x00 /* Clock Control Reg, RW */ |
| 46 | #define XTTCPS_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ | 46 | #define TTC_CNT_CNTRL_OFFSET 0x0C /* Counter Control Reg, RW */ |
| 47 | #define XTTCPS_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ | 47 | #define TTC_COUNT_VAL_OFFSET 0x18 /* Counter Value Reg, RO */ |
| 48 | #define XTTCPS_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ | 48 | #define TTC_INTR_VAL_OFFSET 0x24 /* Interval Count Reg, RW */ |
| 49 | #define XTTCPS_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ | 49 | #define TTC_ISR_OFFSET 0x54 /* Interrupt Status Reg, RO */ |
| 50 | #define XTTCPS_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ | 50 | #define TTC_IER_OFFSET 0x60 /* Interrupt Enable Reg, RW */ |
| 51 | 51 | ||
| 52 | #define XTTCPS_CNT_CNTRL_DISABLE_MASK 0x1 | 52 | #define TTC_CNT_CNTRL_DISABLE_MASK 0x1 |
| 53 | 53 | ||
| 54 | /* | 54 | /* |
| 55 | * Setup the timers to use pre-scaling, using a fixed value for now that will | 55 | * Setup the timers to use pre-scaling, using a fixed value for now that will |
| @@ -62,161 +62,161 @@ | |||
| 62 | #define CNT_CNTRL_RESET (1 << 4) | 62 | #define CNT_CNTRL_RESET (1 << 4) |
| 63 | 63 | ||
| 64 | /** | 64 | /** |
| 65 | * struct xttcps_timer - This definition defines local timer structure | 65 | * struct ttc_timer - This definition defines local timer structure |
| 66 | * | 66 | * |
| 67 | * @base_addr: Base address of timer | 67 | * @base_addr: Base address of timer |
| 68 | * @clk: Associated clock source | 68 | * @clk: Associated clock source |
| 69 | * @clk_rate_change_nb Notifier block for clock rate changes | 69 | * @clk_rate_change_nb Notifier block for clock rate changes |
| 70 | */ | 70 | */ |
| 71 | struct xttcps_timer { | 71 | struct ttc_timer { |
| 72 | void __iomem *base_addr; | 72 | void __iomem *base_addr; |
| 73 | struct clk *clk; | 73 | struct clk *clk; |
| 74 | struct notifier_block clk_rate_change_nb; | 74 | struct notifier_block clk_rate_change_nb; |
| 75 | }; | 75 | }; |
| 76 | 76 | ||
| 77 | #define to_xttcps_timer(x) \ | 77 | #define to_ttc_timer(x) \ |
| 78 | container_of(x, struct xttcps_timer, clk_rate_change_nb) | 78 | container_of(x, struct ttc_timer, clk_rate_change_nb) |
| 79 | 79 | ||
| 80 | struct xttcps_timer_clocksource { | 80 | struct ttc_timer_clocksource { |
| 81 | struct xttcps_timer xttc; | 81 | struct ttc_timer ttc; |
| 82 | struct clocksource cs; | 82 | struct clocksource cs; |
| 83 | }; | 83 | }; |
| 84 | 84 | ||
| 85 | #define to_xttcps_timer_clksrc(x) \ | 85 | #define to_ttc_timer_clksrc(x) \ |
| 86 | container_of(x, struct xttcps_timer_clocksource, cs) | 86 | container_of(x, struct ttc_timer_clocksource, cs) |
| 87 | 87 | ||
| 88 | struct xttcps_timer_clockevent { | 88 | struct ttc_timer_clockevent { |
| 89 | struct xttcps_timer xttc; | 89 | struct ttc_timer ttc; |
| 90 | struct clock_event_device ce; | 90 | struct clock_event_device ce; |
| 91 | }; | 91 | }; |
| 92 | 92 | ||
| 93 | #define to_xttcps_timer_clkevent(x) \ | 93 | #define to_ttc_timer_clkevent(x) \ |
| 94 | container_of(x, struct xttcps_timer_clockevent, ce) | 94 | container_of(x, struct ttc_timer_clockevent, ce) |
| 95 | 95 | ||
| 96 | /** | 96 | /** |
| 97 | * xttcps_set_interval - Set the timer interval value | 97 | * ttc_set_interval - Set the timer interval value |
| 98 | * | 98 | * |
| 99 | * @timer: Pointer to the timer instance | 99 | * @timer: Pointer to the timer instance |
| 100 | * @cycles: Timer interval ticks | 100 | * @cycles: Timer interval ticks |
| 101 | **/ | 101 | **/ |
| 102 | static void xttcps_set_interval(struct xttcps_timer *timer, | 102 | static void ttc_set_interval(struct ttc_timer *timer, |
| 103 | unsigned long cycles) | 103 | unsigned long cycles) |
| 104 | { | 104 | { |
| 105 | u32 ctrl_reg; | 105 | u32 ctrl_reg; |
| 106 | 106 | ||
| 107 | /* Disable the counter, set the counter value and re-enable counter */ | 107 | /* Disable the counter, set the counter value and re-enable counter */ |
| 108 | ctrl_reg = __raw_readl(timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 108 | ctrl_reg = __raw_readl(timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
| 109 | ctrl_reg |= XTTCPS_CNT_CNTRL_DISABLE_MASK; | 109 | ctrl_reg |= TTC_CNT_CNTRL_DISABLE_MASK; |
| 110 | __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 110 | __raw_writel(ctrl_reg, timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
| 111 | 111 | ||
| 112 | __raw_writel(cycles, timer->base_addr + XTTCPS_INTR_VAL_OFFSET); | 112 | __raw_writel(cycles, timer->base_addr + TTC_INTR_VAL_OFFSET); |
| 113 | 113 | ||
| 114 | /* | 114 | /* |
| 115 | * Reset the counter (0x10) so that it starts from 0, one-shot | 115 | * Reset the counter (0x10) so that it starts from 0, one-shot |
| 116 | * mode makes this needed for timing to be right. | 116 | * mode makes this needed for timing to be right. |
| 117 | */ | 117 | */ |
| 118 | ctrl_reg |= CNT_CNTRL_RESET; | 118 | ctrl_reg |= CNT_CNTRL_RESET; |
| 119 | ctrl_reg &= ~XTTCPS_CNT_CNTRL_DISABLE_MASK; | 119 | ctrl_reg &= ~TTC_CNT_CNTRL_DISABLE_MASK; |
| 120 | __raw_writel(ctrl_reg, timer->base_addr + XTTCPS_CNT_CNTRL_OFFSET); | 120 | __raw_writel(ctrl_reg, timer->base_addr + TTC_CNT_CNTRL_OFFSET); |
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | /** | 123 | /** |
| 124 | * xttcps_clock_event_interrupt - Clock event timer interrupt handler | 124 | * ttc_clock_event_interrupt - Clock event timer interrupt handler |
| 125 | * | 125 | * |
| 126 | * @irq: IRQ number of the Timer | 126 | * @irq: IRQ number of the Timer |
| 127 | * @dev_id: void pointer to the xttcps_timer instance | 127 | * @dev_id: void pointer to the ttc_timer instance |
| 128 | * | 128 | * |
| 129 | * returns: Always IRQ_HANDLED - success | 129 | * returns: Always IRQ_HANDLED - success |
| 130 | **/ | 130 | **/ |
| 131 | static irqreturn_t xttcps_clock_event_interrupt(int irq, void *dev_id) | 131 | static irqreturn_t ttc_clock_event_interrupt(int irq, void *dev_id) |
| 132 | { | 132 | { |
| 133 | struct xttcps_timer_clockevent *xttce = dev_id; | 133 | struct ttc_timer_clockevent *ttce = dev_id; |
| 134 | struct xttcps_timer *timer = &xttce->xttc; | 134 | struct ttc_timer *timer = &ttce->ttc; |
| 135 | 135 | ||
| 136 | /* Acknowledge the interrupt and call event handler */ | 136 | /* Acknowledge the interrupt and call event handler */ |
| 137 | __raw_readl(timer->base_addr + XTTCPS_ISR_OFFSET); | 137 | __raw_readl(timer->base_addr + TTC_ISR_OFFSET); |
| 138 | 138 | ||
| 139 | xttce->ce.event_handler(&xttce->ce); | 139 | ttce->ce.event_handler(&ttce->ce); |
| 140 | 140 | ||
| 141 | return IRQ_HANDLED; | 141 | return IRQ_HANDLED; |
| 142 | } | 142 | } |
| 143 | 143 | ||
| 144 | /** | 144 | /** |
| 145 | * __xttc_clocksource_read - Reads the timer counter register | 145 | * __ttc_clocksource_read - Reads the timer counter register |
| 146 | * | 146 | * |
| 147 | * returns: Current timer counter register value | 147 | * returns: Current timer counter register value |
| 148 | **/ | 148 | **/ |
| 149 | static cycle_t __xttc_clocksource_read(struct clocksource *cs) | 149 | static cycle_t __ttc_clocksource_read(struct clocksource *cs) |
| 150 | { | 150 | { |
| 151 | struct xttcps_timer *timer = &to_xttcps_timer_clksrc(cs)->xttc; | 151 | struct ttc_timer *timer = &to_ttc_timer_clksrc(cs)->ttc; |
| 152 | 152 | ||
| 153 | return (cycle_t)__raw_readl(timer->base_addr + | 153 | return (cycle_t)__raw_readl(timer->base_addr + |
| 154 | XTTCPS_COUNT_VAL_OFFSET); | 154 | TTC_COUNT_VAL_OFFSET); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | /** | 157 | /** |
| 158 | * xttcps_set_next_event - Sets the time interval for next event | 158 | * ttc_set_next_event - Sets the time interval for next event |
| 159 | * | 159 | * |
| 160 | * @cycles: Timer interval ticks | 160 | * @cycles: Timer interval ticks |
| 161 | * @evt: Address of clock event instance | 161 | * @evt: Address of clock event instance |
