summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorEric Nelson <eric.nelson@boundarydevices.com>2013-12-20 19:03:04 -0700
committerEric Nelson <eric.nelson@boundarydevices.com>2013-12-20 19:03:04 -0700
commit565a97162fceee00f0618301351138a3f8d19cbc (patch)
treef21993051789e0106298a105c1b03583d78c6d17 /arch
parent0622946af9c6f767a1d8a2336980ba04201ebe35 (diff)
r: add Piezo support (led_pwm) on PWM4 as /sys/class/leds/buzzer
Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-mx6/board-mx6_r.c28
-rw-r--r--arch/arm/mach-mx6/pads-mx6_r.h3
2 files changed, 30 insertions, 1 deletions
diff --git a/arch/arm/mach-mx6/board-mx6_r.c b/arch/arm/mach-mx6/board-mx6_r.c
index 31129356af7d..73b7818c2abf 100644
--- a/arch/arm/mach-mx6/board-mx6_r.c
+++ b/arch/arm/mach-mx6/board-mx6_r.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>
@@ -777,6 +778,29 @@ static struct imx_bt_rfkill_platform_data mxc_bt_rfkill_data = {
.power_change = bt_power_change,
};
+static struct led_pwm pwms[] = {
+ [0] = {
+ .name = "buzzer",
+ .default_trigger = "what_default_trigger",
+ .pwm_id = 3,
+ .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.
*/
@@ -870,7 +894,7 @@ static void __init board_init(void)
imx6q_add_asrc(&imx_asrc_data);
imx6q_add_mxc_pwm(0);
- imx6q_add_mxc_pwm(1);
+ imx6q_add_mxc_pwm(3);
imx6q_add_mxc_pwm_backlight(0, &pwm1_backlight_data);
@@ -881,6 +905,8 @@ static void __init board_init(void)
imx6q_add_dvfs_core(&dvfscore_data);
+ platform_device_register(&platdev_leds_pwd);
+
add_device_buttons();
imx6q_add_hdmi_soc();
diff --git a/arch/arm/mach-mx6/pads-mx6_r.h b/arch/arm/mach-mx6/pads-mx6_r.h
index c9985d428e0f..0a1ad542811d 100644
--- a/arch/arm/mach-mx6/pads-mx6_r.h
+++ b/arch/arm/mach-mx6/pads-mx6_r.h
@@ -135,6 +135,9 @@ static iomux_v3_cfg_t MX6NAME(common_pads)[] = {
NEW_PAD_CTRL(MX6PAD(NANDF_CS0__GPIO_6_11), WEAK_PULLUP), /* pin 10 - NC */
NEW_PAD_CTRL(MX6PAD(SD1_DAT1__GPIO_1_17), WEAK_PULLUP), /* pin 11 - NC */
+ /* PWM4: Audio buzzer*/
+ MX6PAD(SD1_CMD__PWM4_PWMO), /* GPIO1[18] */
+
/* GPIO1 */
MX6PAD(SD1_DAT0__GPIO_1_16), /* Main power enable */