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, ®ulator_list, list) &NB Sp if (r->dev.parent && node = r->dev.of_node) & nbsp return r; & nbsp ........ &NB Sp   } }}
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)