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.

Linux/TPS61052: Facing problem with TPS61052 FLASH LIGHT

Part Number: TPS61052
Other Parts Discussed in Thread: TPS61050, TWL6037, TPS65913

Tool/software: Linux

Hi All,

I am working on TPS61052 flash light with linux-3.12.
I have added platform data in device tree and compile the driver as a module.

I have added below tree structure in dtsi file

tps61050@33 {
        compatible = "tps61052";
        reg = <0x33>;
        status = "okay";
};

But,once i am inserting the .ko modules, The below error log I am getting.

        [ 26.635291] tps6105x 1-0033: TPS6105x found in SHUTDOWN mode

and kernel is crashing.

Can you please help me, how to send platform-data in devicetree to set "TPS6105X_MODE_TORCH_FLASH" mode ?

Thanks & Regard,
Sankar.

  • Hi,

    Can you post the full dmesg log & the full crash log?

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for quick reply.

    Here i am attached full log.

    /mnt insmod tps6105x.ko
    [   29.915836] tps6105x 1-0033: TPS6105x found in SHUTDOWN mode
    [   29.921748] Unable to handle kernel NULL pointer dereference at virtual address 00000000
    [   29.929942] pgd = ae158000
    [   29.932681] [00000000] *pgd=3e7d8831, *pte=00000000, *ppte=00000000
    [   29.939094] Internal error: Oops: 17 [#1] SMP ARM
    [   29.943823] Modules linked in: tps6105x(+)
    [   29.948000] CPU: 3 PID: 259 Comm: insmod Not tainted 3.19.5-00003-g0e3d19d-dirty #10
    [   29.962312] task: af12f500 ti: ae57c000 task.ti: ae57c000
    [   29.967750] PC is at tps6105x_probe+0xa0/0x1ec [tps6105x]
    [   29.973181] LR is at vprintk_emit+0x254/0x5c0
    [   29.977564] pc : [<7f0001c8>]    lr : [<8006abd8>]    psr: 60070013
    [   29.977564] sp : ae57dca8  ip : ae57db08  fp : ae57dcdc
    [   29.989065] r10: af216c00  r9 : 7f000128  r8 : af216c04
    [   29.994310] r7 : 00000000  r6 : af216c20  r5 : 00000000  r4 : ae06a210
    [   30.000857] r3 : af12f500  r2 : 00000000  r1 : af73d3c0  r0 : 00000030
    [   30.007407] Flags: nZCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
    [   30.014564] Control: 10c5387d  Table: 3e15804a  DAC: 00000015
    [   30.020331] Process insmod (pid: 259, stack limit = 0xae57c238)
    [   30.026270] Stack: (0xae57dca8 to 0xae57e000)
    [   30.030655] dca0:                   ae57dcdc ae57dcb8 af216c20 7f00064c af216c20 12000000
    [   30.038862] dcc0: 7f0003e4 af216c20 7f0003cc 7f0003e4 ae57dd0c ae57dce0 804b1820 7f000134
    [   30.047056] dce0: 804b170c 81259994 af216c20 00000000 00000000 7f00064c 7f0006e4 00000002
    [   30.055240] dd00: ae57dd34 ae57dd10 8038b7f8 804b1718 af216c20 7f00064c af216c54 00000000
    [   30.063425] dd20: ae996780 7f002000 ae57dd54 ae57dd38 8038b9bc 8038b6ec af21ec5c 7f00064c
    [   30.071611] dd40: 8038b920 00000000 ae57dd7c ae57dd58 80389fb8 8038b92c af168ca8 af21ec50
    [   30.079795] dd60: aebde5d8 7f00064c ae06a700 80a33b54 ae57dd8c ae57dd80 8038b2d4 80389f68
    [   30.087978] dd80: ae57ddb4 ae57dd90 8038af50 8038b2c0 7f00058c ae57dda0 7f00064c 809f60d8
    [   30.096162] dda0: 00000000 809f60d8 ae57ddcc ae57ddb8 8038c080 8038ae7c 7f000628 809f60d8
    [   30.104346] ddc0: ae57dde4 ae57ddd0 804b37dc 8038c00c 7f0006a8 809f60d8 ae57ddf4 ae57dde8
    [   30.112530] dde0: 7f002018 804b37b4 ae57de84 ae57ddf8 80008a7c 7f00200c 2ed4d000 00000001
    [   30.120715] de00: 809f2d78 af001f00 000000d0 000000d0 7f00069c 00000001 7f0006e4 ae0d2300
    [   30.128899] de20: ae57de3c ae57de30 80049a38 80709424 ae57de4c ae57de40 80709a64 80049a1c
    [   30.137083] de40: ae57de84 ae57de50 800e98a8 80709a2c 00000b83 a0070013 00000001 7f0006a8
    [   30.145268] de60: ae57df48 ae9967c0 7f00069c 00000001 7f0006e4 ae0d2300 ae57df44 ae57de88
    [   30.153453] de80: 80093b50 80008a00 7f0006a8 00007fff 80091664 000002d2 80a0563c 7f0007c8
    [   30.161636] dea0: 7f0006a8 00000000 00000000 01e29008 c0a75c48 7f00069c 81247e50 ae57df1c
    [   30.169819] dec0: 6e72656b 00006c65 00000000 00000000 00000000 00000000 00000000 00000000
    [   30.178003] dee0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7f0003a8
    [   30.186187] df00: 00000003 00000000 00000000 00000000 00000000 8095b76c ffffffff 00001ec3
    [   30.194372] df20: 01e29018 01e29008 00000080 8000ec04 ae57c000 00000000 ae57dfa4 ae57df48
    [   30.202557] df40: 80094044 80092038 c0a75000 00001ec3 c0a75e64 c0a75d5e c0a76ae4 000007e0
    [   30.210741] df60: 00000aa0 00000000 00000000 00000000 0000001a 0000001b 00000013 00000010
    [   30.218925] df80: 0000000d 00000000 00000000 00001ec3 7ef87e9f 0000020b 00000000 ae57dfa8
    [   30.227110] dfa0: 8000ea40 80093f6c 00001ec3 7ef87e9f 01e29018 00001ec3 01e29008 7ef87e9f
    [   30.235295] dfc0: 00001ec3 7ef87e9f 0000020b 00000080 7ef87d94 00000000 00000054 00000000
    [   30.243479] dfe0: 7ef87be0 7ef87bd0 0001a3dc 76e6d9f0 60030010 01e29018 00000000 00000000
    [   30.251658] Backtrace:
    [   30.254143] [<7f000128>] (tps6105x_probe [tps6105x]) from [<804b1820>] (i2c_device_probe+0x114/0x15c)
    [   30.263366]  r7:7f0003e4 r6:7f0003cc r5:af216c20 r4:7f0003e4
    [   30.269106] [<804b170c>] (i2c_device_probe) from [<8038b7f8>] (driver_probe_device+0x118/0x240)
    [   30.277807]  r10:00000002 r9:7f0006e4 r8:7f00064c r7:00000000 r6:00000000 r5:af216c20
    [   30.285718]  r4:81259994 r3:804b170c
    [   30.289335] [<8038b6e0>] (driver_probe_device) from [<8038b9bc>] (__driver_attach+0x9c/0xa0)
    [   30.297775]  r10:7f002000 r8:ae996780 r7:00000000 r6:af216c54 r5:7f00064c r4:af216c20
    [   30.305695] [<8038b920>] (__driver_attach) from [<80389fb8>] (bus_for_each_dev+0x5c/0x90)
    [   30.313873]  r6:00000000 r5:8038b920 r4:7f00064c r3:af21ec5c
    [   30.319603] [<80389f5c>] (bus_for_each_dev) from [<8038b2d4>] (driver_attach+0x20/0x28)
    [   30.327609]  r6:80a33b54 r5:ae06a700 r4:7f00064c
    [   30.332282] [<8038b2b4>] (driver_attach) from [<8038af50>] (bus_add_driver+0xe0/0x1d8)
    [   30.340209] [<8038ae70>] (bus_add_driver) from [<8038c080>] (driver_register+0x80/0xfc)
    [   30.348214]  r7:809f60d8 r6:00000000 r5:809f60d8 r4:7f00064c
    [   30.353949] [<8038c000>] (driver_register) from [<804b37dc>] (i2c_register_driver+0x34/0xc0)
    [   30.362388]  r5:809f60d8 r4:7f000628
    [   30.366008] [<804b37a8>] (i2c_register_driver) from [<7f002018>] (tps6105x_init+0x18/0x24 [tps6105x])
    [   30.375231]  r5:809f60d8 r4:7f0006a8
    [   30.378848] [<7f002000>] (tps6105x_init [tps6105x]) from [<80008a7c>] (do_one_initcall+0x88/0x1e8)
    [   30.387823] [<800089f4>] (do_one_initcall) from [<80093b50>] (load_module+0x1b24/0x1f34)
    [   30.395916]  r10:ae0d2300 r9:7f0006e4 r8:00000001 r7:7f00069c r6:ae9967c0 r5:ae57df48
    [   30.403826]  r4:7f0006a8
    [   30.406386] [<8009202c>] (load_module) from [<80094044>] (SyS_init_module+0xe4/0xe8)
    [   30.414132]  r10:00000000 r9:ae57c000 r8:8000ec04 r7:00000080 r6:01e29008 r5:01e29018
    [   30.422042]  r4:00001ec3
    [   30.424604] [<80093f60>] (SyS_init_module) from [<8000ea40>] (ret_fast_syscall+0x0/0x4c)
    [   30.432697]  r6:0000020b r5:7ef87e9f r4:00001ec3
    [   30.437367] Code: e594004c e59f1120 e2800020 eb4e2101 (e5953000)
    [   30.443527] ---[ end trace b1b8afcf9ff00473 ]---
    Segmentation fault

  • Hi,

    Is your I2Cx device enabled properly? Can you verify the address 0x33 is not duplicated on the I2C bus?

    Have you checked the Kconfig file to make sure you meet all the dependencies listed for the TPS6105x driver?

    Best Regards,
    Yordan
  • Hi Yordan,

    Thanks for quick reply.

    I will check and update you..

    Regards,
    Sankar.
  • Hi Yordan,

    I have used correct I2C bus,0x33 Address no duplicate.

    I have added below debug log in TPS61052.

    dev_dbg(&client->dev,
    "%s No platform data. Using defaults.\n",
    __func__);
    Once loaded the driver its shows "No platform data" in board terminal.

    Please help me,

    tps61050@33 {
    compatible = "tps61052";
    reg = <0x33>;
    status = "okay";
    };

    This platform data is correct or i have to add anything.


    Beat Regards,
    Sankar.
  • Hi Sankar,

    I compared the matching of the .compatilbe value in tps6105x.c and in palmas.c drivers, and I think that in your case compatible="tps61052" does not bind to the correct driver tps6105x.c.

    As you can see in palmas.c, you have:
    static const struct i2c_device_id palmas_i2c_id[] = {
    { "palmas", },
    { "twl6035", },
    { "twl6037", },
    { "tps65913", },
    { /* end */ }
    };
    MODULE_DEVICE_TABLE(i2c, palmas_i2c_id);

    static struct i2c_driver palmas_i2c_driver = {
    .driver = {
    .name = "palmas",
    .of_match_table = of_palmas_match_tbl,
    },

    In addition to that, there is:
    match = of_match_device(of_palmas_match_tbl, &i2c->dev); in the palmas_i2c_probe () function
    and
    static const struct of_device_id of_palmas_match_tbl[] = {
    {
    .compatible = "ti,palmas",
    .data = &palmas_data,
    },

    defined in the driver....

    So, can you try the following approaches, to correctly enable the tps61050 ic:
    1. Modify the driver, by referring some of the other dts compatible drivers in mfd/
    2. Try using:
    compatible = "tps6105x"
    instead of:
    compatible = "tps61052"

    Best Regards,
    Yordan