This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM3352 SDK8.0 Device Tree Add PCA953X

Other Parts Discussed in Thread: AM3352, PCA9538

Hi, everyone
  My platform AM3352, SDK8.0 DTS file is am335x-evmsk.dts
  I2C0 Bus have a PCA-953XGPIOExpander IC(PCA9538)
  Add PCA9538 support in dts file:
  &i2c0 {
 pinctrl-names = "default";
 pinctrl-0 = <&i2c0_pins>;

 status = "okay";
 clock-frequency = <400000>;

 tps: tps@2d {
  reg = <0x2d>;
 };

 s35390a: s35390a@30 {
  compatible = "s35390a";
  reg = <0x30>;
  status = "okay";
 };

 pca9538: pca953x@73 {
  compatible = "nxp,pca9538";
  reg = <0x73>;
  status = "okay";
  linux,gpio-base = <200>;
 };
};

Go to Linux OS, PCA9538 function is OK, But Loading Kernel hvae some error information:

[    1.765106] rtc-s35390a 0-0030: rtc core: registered rtc-s35390a as rtc0
[    1.879007] ------------[ cut here ]------------
[    1.883887] WARNING: CPU: 0 PID: 6 at drivers/gpio/gpio-pca953x.c:634 pca953x_probe+0x364/0x3d4()
[    1.893231] pca953x_get_alt_pdata: device-tree property 'linux,gpio-base' is deprecated!
[    1.901539] Modules linked in:
[    1.904932] CPU: 0 PID: 6 Comm: kworker/u2:0 Not tainted 3.14.26-svn216 #5
[    1.912166] Workqueue: deferwq deferred_probe_work_func
[    1.917642] Backtrace:
[    1.920237] [<c00111ec>] (dump_backtrace) from [<c0011388>] (show_stack+0x18/0x1c)
[    1.928173]  r6:0000027a r5:00000009 r4:dd891b58 r3:c080dd40
[    1.934144] [<c0011370>] (show_stack) from [<c05a49c4>] (dump_stack+0x20/0x28)
[    1.941741] [<c05a49a4>] (dump_stack) from [<c0034d0c>] (warn_slowpath_common+0x6c/0x8c)
[    1.950240] [<c0034ca0>] (warn_slowpath_common) from [<c0034dd0>] (warn_slowpath_fmt+0x38/0x40)

Debuging , I found "linux,gpio-base = <200>;" delete is OK

Now, Device Tree & SDK8.0 is studying!
1. Add PCA9538 don't use Device Tree file, refer to SDK6.0, call function: omap_register_i2c_bus(1, 100, am335x_i2c0_boardinfo,ARRAY_SIZE(am335x_i2c0_boardinfo));
2. Add PCA9538 use DTS, but DTS add some context?

  • I'm forwarding this to the SW team.

  • Hi,

    I think your device tree node for the GPIO expander is wrong.

    Please refer to the example given in linux/Documentation/devicetree/bindings/gpio/gpio-pca953x.txt (or linux/Documentation/devicetree/bindings/gpio/gpio-pcf857x.txt)
    See example in mainline kernel: lxr.free-electrons.com/.../gpio-pca953x.txt

    As per the example your dts node should look something like:
    &i2c0 {
        .....................
        .....................
        pca953x: gpio@0x73 {                                                          // OR just gpio@0x73 {
                      compatible = "nxp,pca9538";
                      reg = <0x73>;
                      status = "okay";
                      linux,gpio-base = <200>;
         };
    };

    Also try adding CONFIG_GPIO_PCA953X=y in your omap2plus_defconfig file.

    Best Regards,
    Yordan

  • You can also comment out the linux,gpio-base property since it is no more needed according this mail lkml.org/.../97
  • Hi,

     Thank you for you help!

     I found the error informaton from pca953x_get_alt_pdata () function.

     WARN(val, "%s: device-tree property 'linux,gpio-base' is deprecated!", __func__);

     Now, mask the line, have no error information.

     I don't know whether can mask?

     By the way, I also have a small problem:

     Add PCA953X node on DTS file, I want to add setup function, init & export the pca9538 8   pin GPIO, on Linux OS

     ls /sys/class/gpio/gpioXXXXX-

     the driver probe, pdata->setup can running?

     How to Modify the DTS file & passed to the Kernel?