From 32eb5baea14434ad254b64303101d27cd43b61ea Mon Sep 17 00:00:00 2001 From: Thomas Klaehn Date: Mon, 14 Aug 2017 10:09:28 +0200 Subject: [PATCH] PWM: enable pwm's in device tree. Signed-off-by: Thomas Klaehn --- .../linux/files/0001-bbb-enable-pwm.patch | 45 +++++++++++++++++++ recipes-kernel/linux/files/enable_pwm.cfg | 6 +++ .../linux/linux-yocto_4.10.bbappend | 7 ++- 3 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 recipes-kernel/linux/files/0001-bbb-enable-pwm.patch create mode 100644 recipes-kernel/linux/files/enable_pwm.cfg diff --git a/recipes-kernel/linux/files/0001-bbb-enable-pwm.patch b/recipes-kernel/linux/files/0001-bbb-enable-pwm.patch new file mode 100644 index 0000000..54b37d2 --- /dev/null +++ b/recipes-kernel/linux/files/0001-bbb-enable-pwm.patch @@ -0,0 +1,45 @@ +diff --git a/arch/arm/boot/dts/am335x-boneblack.dts b/arch/arm/boot/dts/am335x-boneblack.dts +index db00d8ef7b19..9a5f612101db 100644 +--- a/arch/arm/boot/dts/am335x-boneblack.dts ++++ b/arch/arm/boot/dts/am335x-boneblack.dts +@@ -75,6 +75,40 @@ + AM33XX_IOPAD(0x86c, PIN_OUTPUT_PULLDOWN | MUX_MODE7) /* gpmc_a11.GPIO1_27 */ + >; + }; ++ ++ ehrpwm1_pins: pinmux_ehrpwm1a_pins { ++ pinctrl-single,pins = < ++ AM33XX_IOPAD(0x848, PIN_OUTPUT | MUX_MODE6) /* gpmc_a2.ehrpwm1a */ ++ AM33XX_IOPAD(0x84c, PIN_OUTPUT | MUX_MODE6) /* gpmc_a3.ehrpwm1b */ ++ >; ++ }; ++ ++ ehrpwm2_pins: pinmux_ehrpwm2a_pins { ++ pinctrl-single,pins = < ++ AM33XX_IOPAD(0x820, PIN_OUTPUT | MUX_MODE4) /* ehrpwm2a */ ++ AM33XX_IOPAD(0x824, PIN_OUTPUT | MUX_MODE4) /* ehrpwm2b */ ++ >; ++ }; ++}; ++ ++&epwmss1 { ++ status = "okay"; ++}; ++ ++&epwmss2 { ++ status = "okay"; ++}; ++ ++&ehrpwm1 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ehrpwm1_pins>; ++}; ++ ++&ehrpwm2 { ++ status = "okay"; ++ pinctrl-names = "default"; ++ pinctrl-0 = <&ehrpwm2_pins>; + }; + + &lcdc { diff --git a/recipes-kernel/linux/files/enable_pwm.cfg b/recipes-kernel/linux/files/enable_pwm.cfg new file mode 100644 index 0000000..4521209 --- /dev/null +++ b/recipes-kernel/linux/files/enable_pwm.cfg @@ -0,0 +1,6 @@ +CONFIG_PWM=y +CONFIG_PWM_SYSFS=y +CONFIG_PWM_OMAP_DMTIMER=y +CONFIG_PWM_TIECAP=y +CONFIG_PWM_TIEHRPWM=y +CONFIG_PWM_TIPWMSS=y diff --git a/recipes-kernel/linux/linux-yocto_4.10.bbappend b/recipes-kernel/linux/linux-yocto_4.10.bbappend index 8e27c4b..6e4aac6 100644 --- a/recipes-kernel/linux/linux-yocto_4.10.bbappend +++ b/recipes-kernel/linux/linux-yocto_4.10.bbappend @@ -3,8 +3,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=d7810fab7487fb0aad327b76f1be7cd7" FILESEXTRAPATHS_prepend := "${THISDIR}/files:" -SRC_URI += "file://rtl8192cu.cfg " +SRC_URI += " \ + file://rtl8192cu.cfg \ + file://enable_pwm.cfg \ + file://0001-bbb-enable-pwm.patch \ +" KERNEL_CONFIG_FRAGMENTS_append_ti33x = " \ ${WORKDIR}/rtl8192cu.cfg \ + ${WORKDIR}/enable_pwm.cfg \ "