Touch panel DTS Analysis (MSM8994 platform, Atmel chip)

Source: Internet
Author: User

Touch panel DTS Analysis (MSM8994 platform, Atmel chip)

in the MSM8994 platform, Touch Panel's DTS write node/kernel/arch/arm/boot/dts/qcom/msm8994-mtp.dtsi file. Detailed code such as the following:
&soc {          [email protected] {              &NBS P                    [email protected] {        & nbsp                              /    COM patible = "Atmel,atmel_mxt_ts";                                            reg = <0x4a>;          &NBSP ;                                 interrupt- Parent = <&msm_gpio>;                                            interrupts = <61 0x2008>;                                            Avdd-supp Ly  = <&pm8994_l22>;                        &NB Sp                   vdd_io-supply = <&pm8994_l14>;    &NBSP ;                          ,         &NB Sp   .........                            and nbsp            };                      and nbsp        };
In the DTS node. Let's take a look at the avdd-supply and vdd_io-supply two properties. The two properties are used in the C code, such as the following:
/kernel/drivers/input/touchscreen/atmel_mxt_ts.cmxt_probe_regulators (struct mxt_data *data) {... data->reg     _vdd_io = Regulator_get (Dev, "vdd_io");     ... data->reg_avdd = regulator_get (Dev, "avdd"); ........}
/kernel/drivers/regulator/core.cstruct regulator *regulator_get (struct device *dev, const char *id) {return _regulator _get (Dev, id, 0);}
static struct regulator *_regulator_get (struct device *dev, const char *id, int exclusive) {... rdev = Regulat     Or_dev_lookup (Dev, id, &ret);     if (Rdev) goto found; ......}
static struct Regulator_dev *regulator_dev_lookup (struct Devic *dev, const char *supply, int *ret) {    &NBSP;STR UCT Regulator_dev *r;     struct device_node *node;     ........     /* firs t do a DT based lookup */     if (dev && dev->of_node) {          node = Of_get_regulator (Dev, supply)           if (node) {            &NB Sp       List_for_each_entry (R, &regulator_list, list)               &NB Sp          if (r->dev.parent && node = r->dev.of_node)         & nbsp                         return r;        & nbsp                ........                &NB Sp &nbsp      }         }}
static struct Device_node *of_get_regulator (struct device *dev, const char *supply) {struct Device_node *regnode =         NULL;         Char prop_name[32]; ..... snprintf (Prop_name, +, "%s-supply", supply);Regnode = Of_parse_phandle (Dev->of_node, prop_name, 0);........}
From the above code, you can see how the Vdd_io-supply and Avdd-supply properties in DTS are parsed and used.

Pass the string "Avdd" and "Vdd_io" to the Regulator_get () function in the Mxt_probe () function. After a step-by-step call, in the Of_get_regulator () function, the string is merged into a string property that meets the requirements in DTS. The corresponding REGULATOR_DEV structure is then found by the value of the property.

Copyright notice: This article blog original article. Blogs, without consent, may not be reproduced.

Touch panel DTS Analysis (MSM8994 platform, Atmel chip)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.