Hello,
I am working with colibri-imx6ull.
Bsp version 5.6.0.
Colibri evaluation board v3.2.
For give a little context:
For hardware specifications I had to change pwm backlight pin, as defalut the backlight pwm is PWM_A taht is the pin 59. I had to change it for pin 28 that is PWM_B, I made those changes in dts and It works, the pwm backlight is pin 28 right now.
PWM_A (pin 59) I had to use It to control another thing.
I noticed that when the system is booting (whne u-boot is runnning) this pin 59 is turn on.
Cheking in colibri-imx6ull.c find this:
#ifdef CONFIG_DM_VIDEO
static const iomux_v3_cfg_t backlight_pads[] = {
/* Backlight On */
MX6_PAD_JTAG_TMS__GPIO1_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
/* Backlight PWM<A> (multiplexed pin) */
MX6_PAD_NAND_WP_B__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
#define GPIO_BL_ON IMX_GPIO_NR(1, 11)
#define GPIO_PWM_A IMX_GPIO_NR(4, 11)
static int setup_lcd(void)
{
imx_iomux_v3_setup_multiple_pads(backlight_pads, ARRAY_SIZE(backlight_pads));
/* Set BL_ON */
gpio_request(GPIO_BL_ON, "BL_ON");
gpio_direction_output(GPIO_BL_ON, 1);
/* Set PWM<A> to full brightness (assuming inversed polarity) */
gpio_request(GPIO_PWM_A, "PWM<A>");
gpio_direction_output(GPIO_PWM_A, 0);
return 0;
}
#endif
MX6_PAD_NAND_WP_B__GPIO4_IO11 is the pin 59, for my concern u-boot is turn on backlight, so I chenged that to use pin 28 as follow:
@@ -71,11 +78,11 @@ static iomux_v3_cfg_t const backlight_pads[] = {
/* Backlight On */
MX6_PAD_JTAG_TMS__GPIO1_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
/* Backlight PWM<A> (multiplexed pin) */
- MX6_PAD_NAND_WP_B__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
+ MX6_PAD_NAND_DQS__GPIO4_IO16 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
#define GPIO_BL_ON IMX_GPIO_NR(1, 11)
-#define GPIO_PWM_A IMX_GPIO_NR(4, 11)
+#define GPIO_PWM_B IMX_GPIO_NR(4, 16)
static int setup_lcd(void)
{
@@ -85,9 +92,9 @@ static int setup_lcd(void)
gpio_request(GPIO_BL_ON, "BL_ON");
gpio_direction_output(GPIO_BL_ON, 1);
- /* Set PWM<A> to full brightness (assuming inversed polarity) */
- gpio_request(GPIO_PWM_A, "PWM<A>");
- gpio_direction_output(GPIO_PWM_A, 0);
+ /* Set PWM<B> to full brightness (assuming inversed polarity) */
+ gpio_request(GPIO_PWM_B, "PWM<B>");
+ gpio_direction_output(GPIO_PWM_B, 0);
return 0;
}
Now backlight is turn on when the u-boot run but pin 59 that is MX6_PAD_NAND_WP_B__GPIO4_IO11 is still turn on during booting.
I forced turn off the pin doing the follwing:
static iomux_v3_cfg_t const buzzer_pads[] = {
MX6_PAD_NAND_WP_B__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL),
};
imx_iomux_v3_setup_multiple_pads(buzzer_pads, ARRAY_SIZE(buzzer_pads));
/* Set PWM<A> turno off buzzer at init. */
gpio_request(GPIO_BUZZER, "Buzzer");
gpio_direction_output(GPIO_BUZZER, 0);
Force turn-off is working, but for 1 second the pin is in “1” till the gpio is put in “0”.
I think that I have to configure pull down resistors to the pin but I dont know hot to do it.
I know that exist a Pad control register.
I know how to configure that in dts file but I think that I have to configure It before.
MX6_PAD_NAND_WP_B__GPIO4_IO11 | MUX_PAD_CTRL(NO_PAD_CTRL)
Maybe this MUX_PAD_CTRL is where I have to do this change.
So my questions are:
How configure the pin as pull down so the pin is in “0” as default?
Where I have to do the configuration? in which file?