[PATCH 4/4] dt: i2c-omap: Convert i2c driver to use device tree
Cousson, Benoit
b-cousson at ti.com
Thu Jul 28 13:34:31 EDT 2011
Hi Grant,
On 7/14/2011 1:20 AM, Grant Likely wrote:
> On Thu, Jul 14, 2011 at 7:06 AM, G, Manjunath Kondaiah<manjugk at ti.com> wrote:
>>
>> The i2c-omap driver is converted for supporting both
>> dt and non dt builds and driver is modified to use dt
>> data partially.
[...]
>> /* NOTE: driver uses the static register mapping */
>> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> if (!mem) {
>> @@ -1011,11 +1026,25 @@ omap_i2c_probe(struct platform_device *pdev)
>> if (pdata != NULL) {
>> speed = pdata->clkrate;
>> dev->set_mpu_wkup_lat = pdata->set_mpu_wkup_lat;
>> +#if defined(CONFIG_OF)
>> + } else if (pdev->dev.of_node) {
>> + u32 prop;
>> + if (!of_property_read_u32(pdev->dev.of_node, "clock-frequency",
>> +&prop))
>> + speed = prop/100;
>> + else
>> + speed = 100;
Do we have to modify every drivers in order to take advantage of the DT bus?
Cannot we init the already existing pdata during device creation and let
the driver untouched?
I think it is a pity to add all that #ifdefry in the driver to be able
to support two kinds of bus.
Cannot we have an intermediate phase that will deal only with the device
creation with DT?
That will allow us to clean the omap_device creation from hwmod we have
today spread everywhere in plat-omap and mach-omap2.
Regards
Benoit
More information about the linux-arm-kernel
mailing list