[RFC v2 1/8] TILER-DMM: DMM-PAT driver for TI TILER

Varadarajan, Charulatha charu at ti.com
Thu Dec 2 05:31:43 EST 2010


On Thu, Dec 2, 2010 at 15:53, Hari Kanigeri <hari.kanigeri at gmail.com> wrote:
> On Wed, Dec 1, 2010 at 11:16 PM, Varadarajan, Charulatha <charu at ti.com> wrote:
>> On Thu, Dec 2, 2010 at 07:57, Kanigeri, Hari <h-kanigeri2 at ti.com> wrote:
>>> On Wed, Dec 1, 2010 at 8:10 PM, Kanigeri, Hari <h-kanigeri2 at ti.com> wrote:
>>>> On Wed, Dec 1, 2010 at 12:04 AM, Varadarajan, Charulatha <charu at ti.com> wrote:
>>>>> David,
>>>>
>>>>>
>>>>>> +               if (!oh)
>>>>>> +                       goto error;
>>>>>> +
>>>>>> +               data->base = oh->_mpu_rt_va;
>>>>>
>>>>> not required. Make use of platform_get APIs in probe to extract the
>>>>> base, dma and irq info using pdev.
>>>>
>>>> Not sure about using platform_get APIs. I think one has to use
>>>> omap_hwmod_get_mpu_rt_va to get the address, which internally returns
>>>> oh-<_mpu_rt_va.
>>> small correction... omap_device_get_rt_va and not omap_hwmod_get_mpu_rt_va.
>>
>> To get the base address & irq, you need not have to use
>> omap_device_get_rt_va and pass it as
>> pdata and then use it during probe. Instead in probe, you may do
>> something like the following:
>
> If hwmod framework is already doing the ioremap on device address,
> then it is better to use it rather than duplicating the ioremap part
> again in probe function.
> From what I understand regarding omap_device_get_rt_va() function, it
> is added so that Driver's can avoid doing ioremap.
> check Santosh's comment on this API
> http://www.spinics.net/lists/arm-kernel/msg92260.html

Okay. For base address, I agree, as it avoids redoing ioremap in drivers.
For "irq" & "DMA", it is still required to use platform_get*() APIs.

>
>>
>> static int __devinit  dev_probe (*pdev) {
>>   struct resource *res;
>>   void __iomem *base;
>>   u16 irq;
>>   ....
>>   ....
>>   res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>   if (unlikely(!res)) {
>>              ....
>>              return -ENODEV;
>>   }
>>
>>   base = ioremap(res->start, resource_size(res));
>>   if (base) {
>>               ....
>>               return -ENOMEM;
>>   }
>>
>>   res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
>>   if (unlikely(!res)) {
>>               ....
>>               return -ENODEV;
>>   }
>>   irq = res->start;
>>   ....
>>   ....
>> }
>>
>> -V Charulatha



More information about the linux-arm-kernel mailing list