| @@ -106,6 +106,7 @@ struct pl08x_driver_data; · 105 unmodified lines |
| 106 | | 106 | |
| 107 | /** | 107 | /** |
| 108 | * struct vendor_data - vendor-specific config parameters for PL08x derivatives | 108 | * struct vendor_data - vendor-specific config parameters for PL08x derivatives |
| | 109 | * @config_offset: offset to the configuration register |
| 109 | * @channels: the number of channels available in this variant | 110 | * @channels: the number of channels available in this variant |
| 110 | * @signals: the number of request signals available from the hardware | 111 | * @signals: the number of request signals available from the hardware |
| 111 | * @dualmaster: whether this version supports dual AHB masters or not. | 112 | * @dualmaster: whether this version supports dual AHB masters or not. |
| @@ -145,6 +146,8 @@ struct pl08x_bus_data { · 33 unmodified lines |
| 145 | /** | 146 | /** |
| 146 | * struct pl08x_phy_chan - holder for the physical channels | 147 | * struct pl08x_phy_chan - holder for the physical channels |
| 147 | * @id: physical index to this channel | 148 | * @id: physical index to this channel |
| | 149 | * @base: memory base address for this physical channel |
| | 150 | * @reg_config: configuration address for this physical channel |
| 148 | * @lock: a lock to use when altering an instance of this struct | 151 | * @lock: a lock to use when altering an instance of this struct |
| 149 | * @serving: the virtual channel currently being served by this physical | 152 | * @serving: the virtual channel currently being served by this physical |
| 150 | * channel | 153 | * channel |
| @@ -203,7 +206,7 @@ struct pl08x_txd { · 52 unmodified lines |
| 203 | }; | 206 | }; |
| 204 | | 207 | |
| 205 | /** | 208 | /** |
| 206 | * struct pl08x_dma_chan_state - holds the PL08x specific virtual channel | 209 | * enum pl08x_dma_chan_state - holds the PL08x specific virtual channel |
| 207 | * states | 210 | * states |
| 208 | * @PL08X_CHAN_IDLE: the channel is idle | 211 | * @PL08X_CHAN_IDLE: the channel is idle |
| 209 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport | 212 | * @PL08X_CHAN_RUNNING: the channel has allocated a physical transport |
| @@ -226,9 +229,8 @@ enum pl08x_dma_chan_state { · 16 unmodified lines |
| 226 | * @phychan: the physical channel utilized by this channel, if there is one | 229 | * @phychan: the physical channel utilized by this channel, if there is one |
| 227 | * @name: name of channel | 230 | * @name: name of channel |
| 228 | * @cd: channel platform data | 231 | * @cd: channel platform data |
| 229 | * @runtime_addr: address for RX/TX according to the runtime config | 232 | * @cfg: slave configuration |
| 230 | * @at: active transaction on this channel | 233 | * @at: active transaction on this channel |
| 231 | * @lock: a lock for this channel data | | |
| 232 | * @host: a pointer to the host (internal use) | 234 | * @host: a pointer to the host (internal use) |
| 233 | * @state: whether the channel is idle, paused, running etc | 235 | * @state: whether the channel is idle, paused, running etc |
| 234 | * @slave: whether this channel is a device (slave) or for memcpy | 236 | * @slave: whether this channel is a device (slave) or for memcpy |
| @@ -262,7 +264,7 @@ struct pl08x_dma_chan { · 27 unmodified lines |
| 262 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI | 264 | * @lli_buses: bitmask to or in to LLI pointer selecting AHB port for LLI |
| 263 | * fetches | 265 | * fetches |
| 264 | * @mem_buses: set to indicate memory transfers on AHB2. | 266 | * @mem_buses: set to indicate memory transfers on AHB2. |
| 265 | * @lock: a spinlock for this struct | 267 | * @lli_words: how many words are used in each LLI item for this variant |
| 266 | */ | 268 | */ |
| 267 | struct pl08x_driver_data { | 269 | struct pl08x_driver_data { |
| 268 | struct dma_device slave; | 270 | struct dma_device slave; |
| @@ -417,7 +419,7 @@ static void pl08x_start_next_txd(struct pl08x_dma_chan *plchan) · 148 unmodified lines |
| 417 | | 419 | |
| 418 | /* Enable the DMA channel */ | 420 | /* Enable the DMA channel */ |
| 419 | /* Do not access config register until channel shows as disabled */ | 421 | /* Do not access config register until channel shows as disabled */ |
| 420 | while (readl(pl08x->base + PL080_EN_CHAN) & (1 << phychan->id)) | 422 | while (readl(pl08x->base + PL080_EN_CHAN) & BIT(phychan->id)) |
| 421 | cpu_relax(); | 423 | cpu_relax(); |
| 422 | | 424 | |
| 423 | /* Do not access config register until channel shows as inactive */ | 425 | /* Do not access config register until channel shows as inactive */ |
| @@ -484,8 +486,8 @@ static void pl08x_terminate_phy_chan(struct pl08x_driver_data *pl08x, · 60 unmodified lines |
| 484 | | 486 | |
| 485 | writel(val, ch->reg_config); | 487 | writel(val, ch->reg_config); |
| 486 | | 488 | |
| 487 | writel(1 << ch->id, pl08x->base + PL080_ERR_CLEAR); | 489 | writel(BIT(ch->id), pl08x->base + PL080_ERR_CLEAR); |
| 488 | writel(1 << ch->id, pl08x->base + PL080_TC_CLEAR); | 490 | writel(BIT(ch->id), pl08x->base + PL080_TC_CLEAR); |
| 489 | } | 491 | } |
| 490 | | 492 | |
| 491 | static inline u32 get_bytes_in_cctl(u32 cctl) | 493 | static inline u32 get_bytes_in_cctl(u32 cctl) |
| @@ -1834,7 +1836,7 @@ static irqreturn_t pl08x_irq(int irq, void *dev) · 1342 unmodified lines |
| 1834 | return IRQ_NONE; | 1836 | return IRQ_NONE; |
| 1835 | | 1837 | |
| 1836 | for (i = 0; i < pl08x->vd->channels; i++) { | 1838 | for (i = 0; i < pl08x->vd->channels; i++) { |
| 1837 | if (((1 << i) & err) || ((1 << i) & tc)) { | 1839 | if ((BIT(i) & err) || (BIT(i) & tc)) { |
| 1838 | /* Locate physical channel */ | 1840 | /* Locate physical channel */ |
| 1839 | struct pl08x_phy_chan *phychan = &pl08x->phy_chans[i]; | 1841 | struct pl08x_phy_chan *phychan = &pl08x->phy_chans[i]; |
| 1840 | struct pl08x_dma_chan *plchan = phychan->serving; | 1842 | struct pl08x_dma_chan *plchan = phychan->serving; |
| @@ -1872,7 +1874,7 @@ static irqreturn_t pl08x_irq(int irq, void *dev) · 31 unmodified lines |
| 1872 | } | 1874 | } |
| 1873 | spin_unlock(&plchan->vc.lock); | 1875 | spin_unlock(&plchan->vc.lock); |
| 1874 | | 1876 | |
| 1875 | mask |= (1 << i); | 1877 | mask |= BIT(i); |
| 1876 | } | 1878 | } |
| 1877 | } | 1879 | } |
| 1878 | | 1880 | |