Querry on IIO/ADC DT based consumer device probe

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

 



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 :)
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux