Hi all,
We Have customized board based on AM437x and our hardware design uses TIMER4 for PWM output ,for driving Haptic trigger.
We are using TI SDK 7.0 and kernel version 3.12.10
I have done modification in board DTS file for TIMER mode : MOD2 as follows:
am43xx pin mux :
timer4_4in: timer4_pin{
pinctrl-single,pins = <
0x270 (PIN_OUTPUT_PULLUP | MUX_MODE2) /* TIMER4 -> timer4 -> D24 */
>;
};
/* for timer4 device node */
&timer4 {
status = "okay";
pinctrl-names = "default";
pinctrl-0 = <&timer4_pin>;
};
Entry for pinmux is created but timer4 device node is not created in /sys/ entries
My understanding is that pin mux changes are sufficient for creating device node for timer and same device node will be used for user space access.
Bur node is not created for TIMER4. When looked at timer driver for AM43xx, It seems that it only supports system timer/clock event etc.
PWM functionality is not provided in default driver. It is obvious that system timer are not exposed to user, but We have to expose TIMER4 to use-space for setting frequency/duty cycle etc.
Has anybody worked previously for same? Any other modifications are required for working timer as PWM other than pin mux changes?
I had got one old kernel modeul for omap3 which is configuring timer 8,9,10,11 as pwm and exposing device node to user space from :
http://bdml.stanford.edu/Profiles/UsingTheGumstixCOM
But this is 2.6.x kernel and when I modified for AM43xx ,timer4 and our kernel is giving error as
root@am437x-evm:/home# insmod pwm.ko servo=0 timers=4 frequency=1024
[ 267.383006] pwm_init_timer_list : 593
[ 267.387228] pwm_init_timer_list : 620 success
[ 267.394731] pwm_timer_init : 303 start
[ 267.398871] omap_dm_timer_request_specific: Please use omap_dm_timer_request_by_cap/node()
[ 267.407778] pwm_timer_init : 358 ===== timer init failed ====
insmod: can't insert 'pwm.ko': Operation not permitted
This might be beacuase of module uses timer id for initializing device and module is not using Device tree overlays.
Right now I am looking for both approaches developing driver with Device tree with reference to above driver or modify exiting omap2 timer driver for PWM mode.
If anybody has optimized solution or pointers for configuring timer4 as PWM , will be very helpful.