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.

/dev/ entry for ecap pwmss in Am335x beagle bone black

Dear TI E2E Community,

I have verified the pwm module ie.,  ecap module (ecap1_in_pwm1_out & ecap2_in_pwm2_out) of PWMSS of am335x using sysfs entries

I need to create the dev node statically for ecap module ie., for (ecap1_in_pwm1_out & ecap2_in_pwm2_out) , as am new to ti sdk 7 & DTS,

could you please kindly do the needful, in creating the dev nodes statically by making use of  existing pwm driver code & could you please let me know how this pwm driver code can be reused for creating the dev nodes

Kindly do the needful as early as possible, as am stuck with this & trying this from past two days 

Awaiting for your replies,

Many Thanks in advance

  • Hi ,

    From the processors.wiki.ti.com/.../AM335x_PWM_Driver%27s_Guide you will see which way to configure kernel.
    For the settings in a sdk7 you can see the: <>/ti-sdk-am335x-evm-07.00.00.00/board-support/linux-3.12.10-ti2013.12.01/arch/arm/boot/dts/am335x-evm.dts and <>arch/arm/boot/dts/am33xx.dtsi. This platform is very nearest to BBB and you can borrow the configuration. Also it's good to see: Documentation/devicetree/bindings/pwm/pwm-tiecap.txt

    BR
    Ivan
  • Dear Ivan,

    Thanks a lot for your replies,

    #if 1

    /* ADDED BY SRINI FOR PWM CAPTURE IN CUSTOM BOARD */

           ecap1_pins_default: backlight1_pins {

    pinctrl-single,pins = <

    0x18c 0x3 /* ecap1_in_pwm1_out.i2c0_scl MODE3 */

    >;

    };

    ecap1_pins_sleep: ecap1_pins_sleep {

    pinctrl-single,pins = <

    0x18c (PIN_INPUT_PULLDOWN | MUX_MODE7) /* ecap1_in_pwm1_out.i2c0_scl MODE3  */

    >;

    };

    ecap2_pins_default: backlight2_pins {

    pinctrl-single,pins = <

    0x188 0x3 /* ecap2_in_pwm2_out.i2c0_scl MODE3 */

    >;

    };

    ecap2_pins_sleep: ecap2_pins_sleep {

    pinctrl-single,pins = <

    0x188 (PIN_INPUT_PULLDOWN | MUX_MODE7) /* ecap2_in_pwm2_out.i2c0_sda MODE3 */

    >;

    };

    #endif

           epwmss1: epwmss@48302000 {

                         status = "okay";

                         ecap1: ecap@48302100 {

                                     status = "okay";

                                     pinctrl-names = "default", "sleep";

                                     pinctrl-0 = <&ecap1_pins_default>;

                                     pinctrl-1 = <&ecap1_pins_sleep>;

                         };

            };

           epwmss2: epwmss@48304000 {

                                status = "okay";

                                ecap2: ecap@48304100 {

                                          status = "okay";

                                          pinctrl-names = "default", "sleep";

                                          pinctrl-0 = <&ecap2_pins_default>;

                                          pinctrl-1 = <&ecap2_pins_sleep>;

                        };

                   };

    #if 1 //  /* ADDED BY SRINI FOR PWM CAPTURE IN CUSTOM BOARD */

    backlight {

                   compatible = "pwm-backlight";

                    /* pwms = <&ecap1 0 50000 0>; */

                  pwms = <&ecap2 0 50000 0>;

                   brightness-levels = <0 51 53 56 62 75 101 152 255>;

                   default-brightness-level = <8>;

           };

           backlight {

                   compatible = "pwm-backlight";

                   pwms = <&ecap1 0 50000 0>;

                    /* pwms = <&ecap2 0 50000 0>; */

                   brightness-levels = <0 51 53 56 62 75 101 152 255>;

                   default-brightness-level = <8>;

           };

    #endif

    I have already configured the ecap pins as shown above & verified through sysfs

    But now I need to create dev node instead of sysfs, inorder to access in usersapce

    Could you please kindly let me know how this dev nodes can be created for the ecap pin configurations done in am335x-bone-common.dtsi

    Kindly do the needful as early as possible, as am stuck with this from more than 2days in creating the dev nodes for ecap configurations done in dts

    Awaiting for your replies,

    Many Thanks in advance

  • Could anybody please help me out how the char driver interface can be done instead of sysfs for the above ecap module in ti sdk 7

    Kindly do the needful as early as possible
    Awaiting for your replies,
  • OR Could anybody please let me know how the sysfs entries can be converted to dev nodes if possible for the above ecap module in ti sdk 7

    Kindly do the needful as early as possible
    Awaiting for your replies,

  • Hi Srini,

    The listed device tree seems to be well. I think that you repeated the backlight {...} module twice.

    To make a device node as I understand it's good to read which way this is make. I'll give you some links to see this:
    www.xml.com/.../ch03.html
    There is a very good example in a next link :
    www.freesoftwaremagazine.com/.../drivers_linux

    You can grep in a kernel for "module_init" and to see how this is release in your kernel.

    BR
    Ivan