Re: [PATCH] dw_dmac: adjust slave_id accordingly to request line base
From: Andy Shevchenko
Date: Tue Feb 12 2013 - 11:34:37 EST
On Tue, Feb 12, 2013 at 5:56 PM, Vinod Koul <vinod.koul@xxxxxxxxx> wrote:
> On Wed, Jan 30, 2013 at 09:32:56AM +0200, Andy Shevchenko wrote:
>> On Tue, 2013-01-29 at 20:57 +0530, Viresh Kumar wrote:
>> > On Tue, Jan 29, 2013 at 10:52 AM, Mika Westerberg
>> > <mika.westerberg@xxxxxxxxxxxxxxx> wrote:
>> > > We had a discusssion about this with Andy as well. The thing is that there
>> > > is no way in current resource to pass DMA request line numbers supported by
>> > > the controller to the driver in a generic way. We on the other hand have to
>> > > deal this somehow as we have a shared DMA controller on Lynxpoint where the
>> > > offset will start from 16 (but it might be something else as well).
>> > >
>> > > Is there something which limits the usage of IORESOUCE_DMA to be only
>> > > usable for ISA DMA channels?
>> >
>> > Andy,
>> >
>> > Why do we need this request_line_base? Why not program the actual value
>> > directly into the slave structure (base + offset)?
>>
>> Slave device exactly has knowledge about this number slave_id = (base
>> +offset). However...
> Btw request line needs to be programmed by client in slave_id field.
> So why exactly is this required for dma driver?
The slave device driver doesn't know the DMAC limitations and won't
know them. So, it gets request line from the ACPI resource and passes
it to the DMAC. However, the request line is actualy base + offset.
Slave driver has no clue about this and especially about base. The
base is a property of the DMAC.
>> > In case it is required, add it in platform data field or can add DT
>> > binding for it.
>>
>> We get a device from the ACPI CSRT table. During enumeration we don't
>> know what kind of the device it is. From the enumeration point of view
>> each device enumerated from CSRT is a platform device (see
>> drivers/acpi/csrt.c for the details).
>>
>> That's why we have to pass this info somehow to the DMAC driver. And
>> like Mika already mentioned we have no other generic way except
>> IORESOURCE_DMA. If you have something better in mind, please share. We
>> could adopt our code then.
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/