Skip to content

Commit

Permalink
boards/arm64/imx9/imx93-evk: Enable PWM from TPM3ch3 on imx93-evk pin…
Browse files Browse the repository at this point in the history
… GPIO_IO24

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
  • Loading branch information
jlaitine committed Apr 5, 2024
1 parent d5a425e commit b86e159
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 0 deletions.
2 changes: 2 additions & 0 deletions boards/arm64/imx9/imx93-evk/configs/nsh/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_IDLETHREAD_STACKSIZE=8192
CONFIG_IMX9_FLEXIO1_PWM=y
CONFIG_IMX9_GPIO_IRQ=y
CONFIG_IMX9_TPM3_PWM=y
CONFIG_IMX9_TPM3_PWM_CHMUX=0x00000003
CONFIG_IMX9_UART1=y
CONFIG_IMX9_USBDEV_USBC1=y
CONFIG_INIT_ENTRYPOINT="nsh_main"
Expand Down
4 changes: 4 additions & 0 deletions boards/arm64/imx9/imx93-evk/include/board.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@
#define FLEXIO1_PWM2_MUX IOMUX_CFG(IOMUXC_PAD_GPIO_IO06_FLEXIO1_FLEXIO06, IOMUXC_PAD_FSEL_SFAST | IOMUXC_PAD_DSE_X6, 0)
#define FLEXIO1_PWM3_MUX IOMUX_CFG(IOMUXC_PAD_GPIO_IO07_FLEXIO1_FLEXIO07, IOMUXC_PAD_FSEL_SFAST | IOMUXC_PAD_DSE_X6, 0)

/* TPM3 ch3 to PWM pin GPIO_IO24 muxing */

#define TPM3_PWM3_MUX IOMUX_CFG(IOMUXC_PAD_GPIO_IO24_TPM3_CH3, IOMUXC_PAD_FSEL_SFAST | IOMUXC_PAD_DSE_X6, 0)

/****************************************************************************
* Public Data
****************************************************************************/
Expand Down
19 changes: 19 additions & 0 deletions boards/arm64/imx9/imx93-evk/src/imx9_pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <errno.h>

#include "imx9_flexio_pwm.h"
#include "imx9_tpm_pwm.h"

/****************************************************************************
* Pre-processor Definitions
Expand Down Expand Up @@ -87,6 +88,24 @@ int imx9_pwm_setup(void)
{
ret = -ENODEV;
}

if (ret < 0)
{
return ret;
}
#endif

#ifdef CONFIG_IMX9_TPM3_PWM
lower_half = imx9_flexio_pwm_init(PWM_TPM3);

if (lower_half)
{
ret = pwm_register("/dev/pwm2", lower_half);
}
else
{
ret = -ENODEV;
}
#endif

return ret;
Expand Down

0 comments on commit b86e159

Please sign in to comment.