On Tue, Dec 10, 2013 at 07:09:19PM -0800, Kuninori Morimoto wrote: > From: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> > > Remove original filter from usbhsf_dma_init(), > and use SH-DMA suitable filter. > > Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@xxxxxxxxxxx> > --- > drivers/usb/renesas_usbhs/fifo.c | 76 +++++++++++++++++++------------------- > drivers/usb/renesas_usbhs/fifo.h | 3 -- > 2 files changed, 39 insertions(+), 40 deletions(-) > > diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c > index d49f9c3..7f4aec4 100644 > --- a/drivers/usb/renesas_usbhs/fifo.c > +++ b/drivers/usb/renesas_usbhs/fifo.c > @@ -981,23 +981,6 @@ struct usbhs_pkt_handle usbhs_fifo_dma_pop_handler = { > /* > * DMA setting > */ > -static bool usbhsf_dma_filter(struct dma_chan *chan, void *param) > -{ > - struct sh_dmae_slave *slave = param; > - > - /* > - * FIXME > - * > - * usbhs doesn't recognize id = 0 as valid DMA > - */ > - if (0 == slave->shdma_slave.slave_id) > - return false; > - > - chan->private = slave; > - > - return true; > -} > - > static void usbhsf_dma_quit(struct usbhs_priv *priv, struct usbhs_fifo *fifo) > { > if (fifo->tx_chan) > @@ -1009,27 +992,46 @@ static void usbhsf_dma_quit(struct usbhs_priv *priv, struct usbhs_fifo *fifo) > fifo->rx_chan = NULL; > } > > -static void usbhsf_dma_init(struct usbhs_priv *priv, > - struct usbhs_fifo *fifo) > +static struct dma_chan* > +__usbhsf_dma_init(struct usbhs_priv *priv, int id, char *name, > + enum dma_transfer_direction direction) > { > struct device *dev = usbhs_priv_to_dev(priv); > + struct dma_slave_config cfg; > + struct dma_chan *chan; > dma_cap_mask_t mask; > + int ret; > > - dma_cap_zero(mask); > - dma_cap_set(DMA_SLAVE, mask); > - fifo->tx_chan = dma_request_channel(mask, usbhsf_dma_filter, > - &fifo->tx_slave); > + if (!id) > + return NULL; > > dma_cap_zero(mask); > dma_cap_set(DMA_SLAVE, mask); > - fifo->rx_chan = dma_request_channel(mask, usbhsf_dma_filter, > - &fifo->rx_slave); > - > - if (fifo->tx_chan || fifo->rx_chan) > - dev_dbg(dev, "enable DMAEngine (%s%s%s)\n", > - fifo->name, > - fifo->tx_chan ? "[TX]" : " ", > - fifo->rx_chan ? "[RX]" : " "); > + > + chan = dma_request_slave_channel_compat(mask, > + shdma_chan_filter, (void *)id, dev, name); this adds a build warning: drivers/usb/renesas_usbhs/fifo.c:1012:24: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] shdma_chan_filter, (void *)id, dev, name); Please fix it, I'll drop this patch for now. -- balbi
Attachment:
signature.asc
Description: Digital signature