On Thu, Mar 12, 2009 at 10:25:35AM +0100, Guennadi Liakhovetski wrote: > On Thu, 12 Mar 2009, Sascha Hauer wrote: > > > On Thu, Mar 12, 2009 at 09:40:46AM +0100, Guennadi Liakhovetski wrote: > > > One more thing I noticed while looking at your patch 3/4: > > > > > > > +static int pcm990_camera_set_bus_param(struct device *dev, > > > > + unsigned long flags) > > > > +{ > > > > + if (gpio_bus_switch <= 0) > > > > + return 0; > > > > + > > > > + if (flags & SOCAM_DATAWIDTH_8) > > > > + gpio_set_value(NR_BUILTIN_GPIO + 1, 1); > > > > + else > > > > + gpio_set_value(NR_BUILTIN_GPIO + 1, 0); > > > > > > Originally the logic here was "only if flags == SOCAM_DATAWIDTH_8, switch > > > to 8 bits, otherwise do 10 bits. I.e., if flags == SOCAM_DATAWIDTH_8 | > > > SOCAM_DATAWIDTH_10, it would still do the default (and wider) 10 bits. Do > > > you have any reason to change that logic? > > > > I was not aware that I changed any logic. I thought I would get here > > with only one of the SOCAM_DATAWIDTH_* set. Isn't it a bug when we get > > here with more than one width flags set? > > > > The mt9v022 driver has this in set_bus_param: > > > > > > > > /* Only one width bit may be set */ > > > if (!is_power_of_2(width_flag)) > > > return -EINVAL; > > > > > > > And I think it makes sense. > > Ok, then, could you, please add the same test to mt9m001? And, as I > mentioned in a comment to 3/4, please, return an error if switching is > requested but unsupported. Ok, will do. It may be that we need a different approach to the bus width setting in the longer term. For example the mt9m001 can support any thinkable bus width of 1 to inf. bits. This depends on the hardware designer who wired up the connection and not the physical count of data lines the chip has. I have no idea how to implement this though. Sascha -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -- 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