+Required Properties :
+- compatible: Must be "ti,tvp514x-decoder"
There are no significant differences among TVP514* devices as listed above,
you would like to handle above ?
I'm just wondering if you don't need ,for instance, two separate compatibleThere are few differences in init/power sequence tough, I would still
properties, e.g. "ti,tvp5146-decoder" and "ti,tvp5147-decoder" ?
like to have
single compatible property "ti,tvp514x-decoder", If you feel we need separate
property I will change it please let me know on this.
Yes that can work too, I'll do the same.+#if defined(CONFIG_OF)
+static const struct of_device_id tvp514x_of_match[] = {
+ {.compatible = "ti,tvp514x-decoder", },
+ {},
+};
+MODULE_DEVICE_TABLE(of, tvp514x_of_match);
+
+static struct tvp514x_platform_data
+ *tvp514x_get_pdata(struct i2c_client *client)
+{
+ if (!client->dev.platform_data&& client->dev.of_node) {
+ struct tvp514x_platform_data *pdata;
+ struct v4l2_of_endpoint bus_cfg;
+ struct device_node *endpoint;
+
+ pdata = devm_kzalloc(&client->dev,
+ sizeof(struct tvp514x_platform_data),
+ GFP_KERNEL);
+ client->dev.platform_data = pdata;
Do you really need to set client->dev.platform_data this way ?
What about passing struct tvp514x_decoder pointer to this function
and initializing struct tvp514x_decoder::pdata instead ?
Ok+ if (!pdata)
+ return NULL;
+
+ endpoint = of_get_child_by_name(client->dev.of_node,
"port");
+ if (endpoint)
+ endpoint = of_get_child_by_name(endpoint,
"endpoint");
I think you could replace these two calls above with
endpoint = v4l2_of_get_next_endpoint(client->dev.of_node);
Now I see I should have modified this function to ensure it works also whenSo V5 series of V4l OF parser doesn't have this fix ?
'port' nodes are grouped in a 'ports' node.