Re: [PATCH 1/2 v2] dma: pl08x: support fixed signal assignment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Mar 26, 2016 at 12:50:58AM +0100, Linus Walleij wrote:
> + * @signals: the number of request signals available from the hardware
...
>  struct vendor_data {
>  	u8 config_offset;
>  	u8 channels;
> +	u8 signals;

OK about that, but since nothing in this patch uses it,
it belongs in the next patch.

>  	bool dualmaster;
>  	bool nomadik;
>  	bool pl080s;
> +	bool fixed_signals;

But for this I don't see the need, as I've already said.

>  	u32 max_transfer_size;
>  };
>  
> @@ -319,6 +327,15 @@ static int pl08x_request_mux(struct pl08x_dma_chan *plchan)
>  	const struct pl08x_platform_data *pd = plchan->host->pd;
>  	int ret;
>  
> +	/*
> +	 * For engines with fixed signal assignment for slave transfers,
> +	 * this signal is assigned during probe.
> +	 */
> +	if (plchan->host->vd->fixed_signals) {
> +		BUG_ON(plchan->signal < 0);
> +		return 0;
> +	}
> +
>  	if (plchan->mux_use++ == 0 && pd->get_xfer_signal) {

If the platform doesn't have a mux (and thus has fixed signals),
so far pd->get_xfer_signal returned the signal.
Now with dt, pd->get/put_xfer_signal aren't set and thus
pl08x_request/release_mux() won't do anything.  So I think
the check above is not needed.

> @@ -1909,6 +1929,18 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x,
>  
>  		if (slave) {
>  			chan->cd = &pl08x->pd->slave_channels[i];
> +			/*
> +			 * Some implementations have muxed signals, whereas some
> +			 * use a mux in front of the signals and need dynamic
> +			 * assignment of signals.
> +			 */
> +			if (pl08x->vd->fixed_signals) {
> +				chan->signal = i;

As commented earlier, I'd just unconditionally do this assignment.

If the platform uses a mux, pd->get_xfer_signal will
return the real signal (or an error, in which case chan->signal
won't be used).  If it doesn't use a mux (i.e. uses
fixed signals), then this initialization is needed.

> +				chan->name = chan->cd->bus_id;

as commented earlier, pl08x_dma_slave_init() already does this

> +				dev_dbg(&pl08x->adev->dev,
> +					"assign fixed signal %u to channel %s",
> +					chan->signal, chan->name);
> +			}
>  			pl08x_dma_slave_init(chan);
>  		} else {
>  			chan->cd = &pl08x->pd->memcpy_channel;


Johannes
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux PCI]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux