summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2014-01-02 17:31:22 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2014-01-02 17:31:22 -0700
commite0a1e2a71d39e947af0ac5dcea9d957432e2f8b4 (patch)
tree06e07a11a72fbf1ec48a58a414fe68e28c49a41c
parent4f9a10cb850afa07697bb3a543cf70dc7fbda2d6 (diff)
sp: Add PWM buzzer on PWM1 (SD3_DAT3)
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
-rw-r--r--arch/arm/mach-mx6/board-mx6_sp.c29
-rw-r--r--arch/arm/mach-mx6/pads-mx6_sp.h7
2 files changed, 28 insertions, 8 deletions
diff --git a/arch/arm/mach-mx6/board-mx6_sp.c b/arch/arm/mach-mx6/board-mx6_sp.c
index e80f56680fad..b617b3e2c89b 100644
--- a/arch/arm/mach-mx6/board-mx6_sp.c
+++ b/arch/arm/mach-mx6/board-mx6_sp.c
@@ -24,6 +24,7 @@
#include <linux/irq.h>
#include <linux/init.h>
#include <linux/input.h>
+#include <linux/leds_pwm.h>
#include <linux/nodemask.h>
#include <linux/clk.h>
#include <linux/platform_device.h>
@@ -567,6 +568,28 @@ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
{
}
+static struct led_pwm pwms[] = {
+ [0] = {
+ .name = "buzzer",
+ .default_trigger = "what_default_trigger",
+ .pwm_id = 0,
+ .active_low = 0,
+ .max_brightness = 0x100,
+ .pwm_period_ns = 3822192, /* middle "C" is 261.63 hz or */
+ },
+};
+
+static struct led_pwm_platform_data plat_led = {
+ .num_leds = 1,
+ .leds = pwms,
+};
+static struct platform_device platdev_leds_pwd = {
+ .name = "leds_pwm",
+ .dev = {
+ .platform_data = &plat_led,
+ },
+};
+
/*!
* Board specific initialization.
*/
@@ -641,10 +664,10 @@ static void __init mx6_board_init(void)
/* release USB Hub reset */
gpio_set_value(USB_HUB_RESET, 1);
- imx6q_add_mxc_pwm(2);
- imx6q_add_mxc_pwm(3);
+ imx6q_add_mxc_pwm(0);
+ platform_device_register(&platdev_leds_pwd);
- imx6q_add_mxc_pwm_backlight(2, &mx6_pwm3_backlight_data);
+ imx6q_add_mxc_pwm(3);
imx6q_add_mxc_pwm_backlight(3, &mx6_pwm4_backlight_data);
imx6q_add_otp();
diff --git a/arch/arm/mach-mx6/pads-mx6_sp.h b/arch/arm/mach-mx6/pads-mx6_sp.h
index f06a89901cbb..ebcda37d5052 100644
--- a/arch/arm/mach-mx6/pads-mx6_sp.h
+++ b/arch/arm/mach-mx6/pads-mx6_sp.h
@@ -93,11 +93,8 @@ static iomux_v3_cfg_t MX6NAME(common_pads)[] = {
*/
NEW_PAD_CTRL(MX6PAD(SD1_CMD__PWM4_PWMO), WEAK), /* GPIO1[18], J9 pin 10 */
- /*
- * Display - RGB Backlight
- * 4.3 inch is WQVGA 480x272
- */
- MX6PAD(SD1_DAT1__PWM3_PWMO), /* GPIO1[17], J9 pin 9, also pwm3 */
+ /* PWM1: Buzzer */
+ MX6PAD(SD1_DAT3__PWM1_PWMO), /* GPIO1[21] */
/*
* I2C1, used by