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.

bq32000 dts adding

Other Parts Discussed in Thread: BQ32000

Hi team,


We are using BQ320000 RTC in our imx6 platform.

Linux 3.10.53 is used.

In the kernel, I can see rtc-bq32k.c driver present under drivers/rtc/.

I would like to know about the changes that need to be done in the DTS file. I am newbie to DTS and I have worked in older kernel(DTS free implementation)

I have attached the .c and dts file. please check the changes that I have done. Will it work ??

4111.rtc-bq32k.c

Please check from line lines 17 and from lines 172. Does this enough in .c file for DTS bindings ??

1374.imx6qdl.dtsi.txt

Is above changes is enough in DTS file. check from line 901

Please check and clarify me.

Thanks in Advance.

Sarjoon

  • Hello Sarjoon,

    This one with the device tree binding, taken from the documentation of the latest SDK, should work on your board:

    * TI BQ32000                I2C Serial Real-Time Clock
    
    Required properties:
    - compatible: Should contain "ti,bq32000".
    - reg: I2C address for chip
    
    Optional properties:
    - trickle-resistor-ohms : Selected resistor for trickle charger
           Values usable are 1120 and 20180
           Should be given if trickle charger should be enabled
    - trickle-diode-disable : Do not use internal trickle charger diode
           Should be given if internal trickle charger diode should be disabled
    Example:
           bq32000: rtc@68 {
                   compatible = "ti,bq32000";
                   trickle-resistor-ohms = <1120>;
                   reg = <0x68>;
           };

    Best regards,
    Kemal

  • Dear Kemal,


    Thanks for sharing the code.

    I will use. But one doubt I have is I cant find the device trees "compatible" in the rtc-bq32k.c file

    I mean I cant find the "of compatible" table in the .c file I can see only "bq32k_id" table.

    In the .c file its mentioned as "bq32000" in bq32k_id table whereas in the DTS you mentioned as "ti,bq32000" compatible is not matching know ?

    Anything need to be done ?

    Where and how we can do the changes

  • This part of the code should do the trick:
    static const struct i2c_device_id bq32k_id[] = {
    { "bq32000", 0 },
    { }