All of lore.kernel.org
 help / color / mirror / Atom feed
* Querry on IIO/ADC DT based consumer device probe
@ 2012-10-05  9:07 Naveen Krishna Ch
  2012-10-05 11:35 ` Jonathan Cameron
  2012-11-08 16:53 ` Alban Bedel
  0 siblings, 2 replies; 5+ messages in thread
From: Naveen Krishna Ch @ 2012-10-05  9:07 UTC (permalink / raw)
  To: linux-iio, jic23

Hello All,

I'm trying to add an ADC driver under IIO/ADC.
Machine is DT based so, passing the ADC device as tree node and
consumer devices (thermistors) as child nodes via DT.

I don't find a frame work to parse the child nodes and probe them like
I2C does using of/of_i2c.c

The DT snippet:
       adc@12D10000 {
                thermistor@3 {
                        compatible = "ntc,ncp15wb473";
                        consumer-name = "ntc,ncp15wb473";
                        consumer-channel = "adc-3";
                        pullup-uV = <1800000>;
                        pullup-ohm = <47000>;
                        pulldown-ohm = <0>;
                        connected-positive;
                };

                thermistor@4 {
                        compatible = "ntc,ncp15wb473";
                        consumer-name = "ntc,ncp15wb473";
                        consumer-channel = "adc-4";
                        pullup-uV = <1800000>;
                        pullup-ohm = <47000>;
                        pulldown-ohm = <0>;
                        connected-positive;
                };
    };

Parsing snippet:
 for_each_child_of_node(node, client_node) {
                char *channel, *label = NULL;

                if (of_property_read_string(client_node,
"consumer-channel", &channel) != 0) {
                        dev_err(&pdev->dev, "Missing consumer-channel
property in the DT.\n");
                        return -EINVAL;
                }

                client_map[i].consumer_channel = channel;
                label = "lable-adc";      //TODO
                client_map[i].adc_channel_label = label;


                if (of_property_read_string(client_node,
"consumer-name", &client_map[i].consumer_dev_name) != 0) {
                        dev_err(&pdev->dev, "Missing consumer-name
property in the DT.\n");
                        return -EINVAL;
                }

                i++;
        }

Can some one suggest a way to get the consumer thermistor driver to
get probed from iio framework via DT.
Kindly, point me towards any existing framework to do the same.

-- 
Shine bright,
(: Nav :)

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

end of thread, other threads:[~2012-11-09 14:48 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-05  9:07 Querry on IIO/ADC DT based consumer device probe Naveen Krishna Ch
2012-10-05 11:35 ` Jonathan Cameron
2012-11-08 16:53 ` Alban Bedel
2012-11-09 14:48   ` Lars-Peter Clausen
2012-11-09 14:48     ` Lars-Peter Clausen

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.