Debugging devicetree nodes for epdc pmic driver with 6sl

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debugging devicetree nodes for epdc pmic driver with 6sl

Jump to solution
2,219 Views
jayakumar2
Contributor V

Hi,

I'm porting my system from 3.0.35 to 3.14.28 kernel with the new yocto on a 6sololite board.

I'm happy to say that it is booting and goes up to the boot prompt.

Now, I'm working on implementing support for the PMIC that I use with the epdc driver. My board has a TI TPS65185 EPDC PMIC.

By default, the 6sl implementation has a sample for max17135 so I modeled the implementation on it and reused code from the 3.0.35 driver while adding the devicetree node parsing code based on the max17135 source.

The problem I'm facing now is that I can't seem to get the driver to be probed at bootup. I suspect I'm doing something wrong in how I'm declaring my devicetree nodes and so the pmic driver is not getting bound.

What I have is the following:

&i2c1 {

        clock-frequency = <100000>;

        pinctrl-names = "default";

        pinctrl-0 = <&pinctrl_i2c1>;

        status = "okay";

...

        tps6518x@68 {

                compatible = "ti,tps6518x-pmic";

                reg = <0x68>;

                vneg_pwrup = <1>;

                gvee_pwrup = <2>;

                vpos_pwrup = <10>;

                gvdd_pwrup = <12>;

                gvdd_pwrdn = <1>;

                vpos_pwrdn = <2>;

                gvee_pwrdn = <8>;

                vneg_pwrdn = <10>;

                gpio_pmic_pwrgood = <&gpio2 13 0>;

                gpio_pmic_vcom_ctrl = <&gpio2 11 0>;

                gpio_pmic_wakeup = <&gpio2 14 0>;

                gpio_pmic_intr = <&gpio2 12 0>;

                regulators {

                        DISPLAY_reg: DISPLAY {

                                regulator-name = "DISPLAY";

                        };

                        VCOM_reg: VCOM {

                                regulator-name = "VCOM";

                                /* 2's-compliment, -4325000 */

                                regulator-min-microvolt = <0xffbe0178>;

                                /* 2's-compliment, -500000 */

                                regulator-max-microvolt = <0xfff85ee0>;

                        };

                        V3P3_reg: V3P3 {

                                regulator-name = "V3P3";

                        };

                };

        };

This dts compiles fine and I've verified that it is genuinely from this dts by deleting the dtb and other dts-es and ensuring this one gets generated.

At bootup, I see:

i2c i2c-0: IMX I2C adapter registered

i2c i2c-1: IMX I2C adapter registered

i2c-core: driver [tps6518x] using legacy suspend method

i2c-core: driver [tps6518x] using legacy resume method

cfg80211: Calling CRDA to update world regulatory domain

backlight.16 supply power not found, using dummy regulator

imx_epdc_fb 20f4000.epdc: Unable to get display PMIC regulator.err = 0xfffffdfb

I can also see my pmic drivers show up in sysfs:

/sys/bus/i2c/drivers/tps6518x

/sys/bus/i2c/drivers/tps6518x/bind

/sys/bus/i2c/drivers/tps6518x/uevent

/sys/bus/i2c/drivers/tps6518x/unbind

/sys/bus/platform/drivers/tps6518x-reg

/sys/bus/platform/drivers/tps6518x-reg/bind

/sys/bus/platform/drivers/tps6518x-reg/uevent

/sys/bus/platform/drivers/tps6518x-reg/unbind

/sys/bus/platform/drivers/tps6518x_utils

/sys/bus/platform/drivers/tps6518x_utils/bind

/sys/bus/platform/drivers/tps6518x_utils/uevent

/sys/bus/platform/drivers/tps6518x_utils/unbind

/sys/bus/platform/drivers/tps6518x_sensor

/sys/bus/platform/drivers/tps6518x_sensor/bind

/sys/bus/platform/drivers/tps6518x_sensor/uevent

/sys/bus/platform/drivers/tps6518x_sensor/unbind

I have verified the device is physically present at the specified i2c bus (i2c1 in devicetree which is i2c0 physically) and i2c address (0x68) and working using i2cget.

# i2cget -y -f 0 0x68 0x10

0x65

(0x65 is the correct result for the revision id register of the tps65185 pmic).

I've tried various combinations in the compatible line, eg:

        tps6518x@68 {

                compatible = "ti,tps6518x";

                reg = <0x68>;

But I can't seem to get it to be detected.

In my pmic driver code, I do:

static struct i2c_driver tps6518x_driver = {

        .driver = {

                   .name = "tps6518x",

                   .owner = THIS_MODULE,

        },

static const struct i2c_device_id tps6518x_id[] = {

       { "tps6518x", 0 },

       { }

};

MODULE_DEVICE_TABLE(i2c, tps6518x_id);

I would welcome some advice/suggestions on how to debug this issue.

Thanks!

Labels (2)
Tags (1)
1 Solution
1,072 Views
sandsmark
Contributor I

Hi!

I ported the driver, and it seems to work. I'm not sure how to attach patches here, but you can view a patch for the head of the imx_3.14.28_1.0.0_ga branch here: http://sprunge.us/LWHf

Martin Sandsmark

View solution in original post

4 Replies
1,073 Views
sandsmark
Contributor I

Hi!

I ported the driver, and it seems to work. I'm not sure how to attach patches here, but you can view a patch for the head of the imx_3.14.28_1.0.0_ga branch here: http://sprunge.us/LWHf

Martin Sandsmark

1,072 Views
jayakumar2
Contributor V

Thanks Martin. I just tried your patch and it works great!

0 Kudos
1,072 Views
BiyongSUN
NXP Employee
NXP Employee

We check the binding guide in the

imx-rel_imx_3.14.28_1.0.0_ga\Documentation\devicetree\bindings\regulator

no binding guide for TPS65185.

Please ask TI for the binding guide.

0 Kudos
1,072 Views
alejandrolozan1
NXP Employee
NXP Employee

Hi,

As I see the driver you are writing is not device tree compatible.

Can you share the entire code so we can take a look at it?

Best Regards,

Alejandro

0 Kudos