On 09/27/2012 04:07 PM, Guennadi Liakhovetski wrote:
With OF we aren't getting platform data any more. To minimise changes we create all the missing data ourselves, including compulsory struct soc_camera_link objects. Host-client linking is now done, based on the OF data. Media bus numbers also have to be assigned dynamically. Signed-off-by: Guennadi Liakhovetski<g.liakhovetski@xxxxxx> ---
...
static int soc_camera_i2c_notify(struct notifier_block *nb, unsigned long action, void *data) { @@ -1203,13 +1434,20 @@ static int soc_camera_i2c_notify(struct notifier_block *nb, struct v4l2_subdev *subdev; int ret; - if (client->addr != icl->board_info->addr || - client->adapter->nr != icl->i2c_adapter_id) + dev_dbg(dev, "%s(%lu): %x on %u\n", __func__, action, + client->addr, client->adapter->nr); + + if (!soc_camera_i2c_client_match(icl, client)) return NOTIFY_DONE; switch (action) { case BUS_NOTIFY_BIND_DRIVER: client->dev.platform_data = icl; + if (icl->of_link) { + struct soc_camera_of_client *sofc = container_of(icl->of_link, + struct soc_camera_of_client, of_link); + soc_camera_of_i2c_ifill(sofc, client); + } return NOTIFY_OK; case BUS_NOTIFY_BOUND_DRIVER:
There is no need for different handling of this event as well ? Further, there is code like: adap = i2c_get_adapter(icl->i2c_adapter_id); which is clearly not going to work in OF case. Could you clarify how it is supposed to work ? -- Thanks, Sylwester -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html