Re: [PATCH] clk: cdce925: add support for CDCE913, CDCE937, and CDCE949

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

 




2016-11-02 2:48 GMT+09:00 Stephen Boyd <sboyd@xxxxxxxxxxxxxx>:
> On 11/01, Akinobu Mita wrote:
>> 2016-11-01 3:15 GMT+09:00 Stephen Boyd <sboyd@xxxxxxxxxxxxxx>:
>> > On 10/31, Akinobu Mita wrote:
>> >> @@ -728,13 +780,19 @@ static int cdce925_probe(struct i2c_client *client,
>> >>  }
>> >>
>> >>  static const struct i2c_device_id cdce925_id[] = {
>> >> -     { "cdce925", 0 },
>> >> +     { "cdce913", CDCE913 },
>> >> +     { "cdce925", CDCE925 },
>> >> +     { "cdce937", CDCE937 },
>> >> +     { "cdce949", CDCE949 },
>> >>       { }
>> >>  };
>> >>  MODULE_DEVICE_TABLE(i2c, cdce925_id);
>> >>
>> >>  static const struct of_device_id clk_cdce925_of_match[] = {
>> >> +     { .compatible = "ti,cdce913" },
>> >>       { .compatible = "ti,cdce925" },
>> >> +     { .compatible = "ti,cdce937" },
>> >> +     { .compatible = "ti,cdce949" },
>> >
>> > Doesn't this need to be updated to point to the correct enum
>> > values?
>>
>> I think it isn't needed. Because the data field in struct of_device_id
>> for this driver is not used even if the device is registered from
>> device tree.  But the driver_data in i2c_device_id is used instead.
>
> Ok. Have you tested this driver with DT or platform data? Do you
> prefix the compatible string with "ti," in the DT case?

I have tested with DT with compatible = "ti,cdce937" and checked that
correct i2c_device_id is passed by the caller of cdce925_probe().

According to of_i2c_register_device() in drivers/i2c/i2c-core.c,
the manufacturer prefix like "ti," is stripped from i2c_client->name by
of_modalias_node().  So i2c_match_id() can find correct i2c_device_id
entry and ->probe() is called with it.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]
  Powered by Linux