Re: [PATCH 2/2] TVP514x Driver with Review comments fixed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Friday 28 November 2008, David Brownell wrote:
> On Friday 28 November 2008, Hiremath, Vaibhav wrote:
> > Will have to now think how to differentiate between these
> > two chips and handle this sequence. 
> 
> That's really easy, the "id" parameter to probe() tells you:
> 
> 	if (strcmp(id->name, "tvp5146") == 0)
> 		/* original '46 part ... */;
> 	else if (strmcp(id->name, "tvp5146m2") == 0)
> 		/* new '46m2 version ... */
> 	... etc

... although it's even easier to use id->driver_data to
hold, for example, a bitmask telling various attributes
of that particular device.  Examples here:

	- does it have the extra '46 registers?
	- does it use the original '46 init sequence?
	- or the new m2 one?
	- or the original '47 init sequence?
	- or the new m1 version?
	- ...

Another common use of driver_data is to hold a pointer
to a struct holding chip-specific data that doesn't fit
into a simple bitmask.

- Dave
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux