All of lore.kernel.org
 help / color / mirror / Atom feed
* [lm-sensors] Dealing with optional i2c devices in a devicetree
@ 2015-06-05  6:03 ` Chris Packham
  0 siblings, 0 replies; 16+ messages in thread
From: Chris Packham @ 2015-06-05  6:03 UTC (permalink / raw)
  To: devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
  Cc: jdelvare-l3A5Bk7waGM@public.gmane.org,
	linux-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org,
	lm-sensors-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org,
	shardy-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	guillaume.roguez-4ysUXcep3aM1wj+D4I0NRVaTQe2KTcn/@public.gmane.org

Hi,

I'm working on a new board and one feature it as is a plug-in module 
with an ADS7830 voltage monitor on it. This will be used during 
manufacturing to sanity check that various voltage rails are within 
expected ranges.

I have a dts entry for the device as below (with some omissions for the 
sake of clarity)

	soc {
		internal-regs {
			i2c@11000 {
				ads7830@48 {
					compatible = "ads7830";
					reg = <0x48>;
				};
			};
		};
	};

The problem is that when the manufacturing card is not installed the 
device still shows up in /sys/class/hwmon/hwmon0/ and 
/sys/bus/i2c/devices/0-0048/ despite it not actually being present. If I 
was using an old style initialization I could use 
i2c_new_probed_device() which I think would stop the drivers probe() 
function from being called

Looking at the ads7828_probe() function it doesn't actually do anything 
with the i2c device before calling hwmon_device_register(). Some hwmon 
drivers like lm73_probe() do attempt to read from the device and bail if 
the read fails. I can probably fix my problem by doing something similar 
in the ads7828_probe(), but there are other drivers that have a similar 
probe function.

Is there a better way of getting the devicetree machinery to avoid the 
call to the driver probe function in the first place?

Thanks,
Chris
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors

^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2015-06-08 15:03 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-05  6:03 [lm-sensors] Dealing with optional i2c devices in a devicetree Chris Packham
2015-06-05  6:03 ` Chris Packham
     [not found] ` <55713BB1.80004-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2015-06-05  7:26   ` [lm-sensors] " Arnd Bergmann
2015-06-05  7:26     ` Arnd Bergmann
2015-06-08  6:01     ` [lm-sensors] " Chris Packham
2015-06-08  6:01       ` Chris Packham
2015-06-05  7:30   ` [lm-sensors] " Guenter Roeck
2015-06-05  7:30     ` Guenter Roeck
     [not found]     ` <55714FFB.3000608-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2015-06-08  6:01       ` [lm-sensors] " Chris Packham
2015-06-08  6:01         ` Chris Packham
     [not found]         ` <55752FD4.6050700-6g8wRflRTwXFdCa3tKVlE6U/zSkkHjvu@public.gmane.org>
2015-06-08 12:11           ` [lm-sensors] " Enrico Weigelt, metux IT consult
2015-06-08 12:11             ` Enrico Weigelt, metux IT consult
     [not found]             ` <55758667.70501-d/C+FbuhHiA@public.gmane.org>
2015-06-08 15:03               ` [lm-sensors] " Guenter Roeck
2015-06-08 15:03                 ` Guenter Roeck
2015-06-05  8:06   ` [lm-sensors] " Jean Delvare
2015-06-05  8:06     ` Jean Delvare

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.