From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sylwester Nawrocki Subject: Re: [PATCH 10/14] media: soc-camera: support OF cameras Date: Fri, 05 Oct 2012 21:11:36 +0200 Message-ID: <506F30E8.10206@gmail.com> References: <1348754853-28619-1-git-send-email-g.liakhovetski@gmx.de> <1348754853-28619-11-git-send-email-g.liakhovetski@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1348754853-28619-11-git-send-email-g.liakhovetski@gmx.de> Sender: linux-media-owner@vger.kernel.org To: Guennadi Liakhovetski Cc: linux-media@vger.kernel.org, devicetree-discuss@lists.ozlabs.org, Laurent Pinchart , Hans Verkuil , Magnus Damm , linux-sh@vger.kernel.org, Mark Brown , Stephen Warren , Arnd Bergmann , Grant Likely List-Id: devicetree@vger.kernel.org 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 > --- ... > 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