On Thu, 2009-06-25 at 08:39 +0200, Hans Verkuil wrote: > On Thursday 25 June 2009 04:40:11 Andy Walls wrote: > > On Tue, 2009-06-23 at 14:33 +0200, Hans Verkuil wrote: > > > > On Tue, 2009-06-23 at 11:39 +0800, Terry Wu wrote: > > > > > > > > > There is already an s_gpio in the core ops. It would be simple to add a > > > g_gpio as well if needed. > > > > Hans, > > > > As you probably know > > > > int (*s_gpio)(v4l2_subdev *sd, u32 val); > > > > is a little too simple for initial setup of GPIO pins. With the > > collection of chips & cores supported by cx25840 module, setting the > > GPIO configuration also requires: > > > > direction: In or Out > > multiplexed pins: GPIO or some other function > > > > I could tack on direction as an argument to s_gpio(), but I think that > > is a bit inconvenient.. I'd rather have a > > > > int (*s_gpio_config)(v4l2_subdev *sd, u32 dir, u32 initval); > > > > but that leaves out the method for multiplexed pin/pad configuration. > > Perhaps explicity setting a GPIO direction to OUT could be an implicit > > indication that a multiplexed pin should be set to it's GPIO function. > > However, that doesn't help for GPIO inputs that might have their pins > > multiplexed with other functions. > > > > Here's an idea on how to specify multiplexed pin configuration > > information and it could involve pins that multiplex functions other > > than GPIO (the CX25843 is quite flexible in this regard): > > > > int (*s_pin_function)(v4l2_subdev *sd, u32 pin_id, u32 function); > > > > The type checking ends up pretty weak, but I figured it was better than > > a 'void *config' that had a subdev specific collection of pin > > configuration information. > > > > Comments? > > Hi Andy, > > Is there any driver that needs to setup the multiplex functions? If not, then > I would not add support for this at the moment. Well, the group of GPIO pins in question for the CX23885 are all multiplexed with other functions. We could just initialize the CX23885 to have those pins set as GPIOs, but I have to check the cx23885 driver to make sure that's safe. > Adding unused code is a bad > idea in general. Yes. > In addition, such information should only be needed at initialization time, > and since we now have the new v4l2_i2c_new_subdev_cfg function I think that > that is the right way to do this. The same approach can be used for setting > the gpio pin directions. That too is something you setup at config time. Yup. OK, thanks. Regards, Andy > Regards, > > Hans > -- 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