diff options
author | Juergen Beisert <jbe@pengutronix.de> | 2011-11-12 21:37:21 +0100 |
---|---|---|
committer | Juergen Beisert <jbe@pengutronix.de> | 2011-11-12 23:22:38 +0100 |
commit | 2f46491012f817b67ededf9f9134ba5e48289c99 (patch) | |
tree | 6b9a3dde170454a60fd96dc34ef667249e403c00 | |
parent | 618ad6b707570f4deec0bf04c1d3632b4a3b1f7e (diff) | |
download | OSELAS.BSP-Pengutronix-Mini6410-2f46491012f817b67ededf9f9134ba5e48289c99.tar.gz OSELAS.BSP-Pengutronix-Mini6410-2f46491012f817b67ededf9f9134ba5e48289c99.tar.xz |
Kernel 3.1: add buzzer support
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
6 files changed, 97 insertions, 1 deletions
diff --git a/configs/platform-friendlyarm-mini6410/Changelog b/configs/platform-friendlyarm-mini6410/Changelog index 95d9c05..5ef4fb9 100644 --- a/configs/platform-friendlyarm-mini6410/Changelog +++ b/configs/platform-friendlyarm-mini6410/Changelog @@ -5,6 +5,7 @@ - keep in sync with stable release .9 * Kernel 3.1: - keep in sync with stable release .1 + - add buzzer support 2011-11-07 Juergen Beisert <jbe@pengutronix.de> diff --git a/configs/platform-friendlyarm-mini6410/kernelconfig-3.1 b/configs/platform-friendlyarm-mini6410/kernelconfig-3.1 index 59ac6a5..e21c52b 100644 --- a/configs/platform-friendlyarm-mini6410/kernelconfig-3.1 +++ b/configs/platform-friendlyarm-mini6410/kernelconfig-3.1 @@ -855,7 +855,17 @@ CONFIG_TOUCHSCREEN_S3C2410=y # CONFIG_TOUCHSCREEN_W90X900 is not set # CONFIG_TOUCHSCREEN_ST1232 is not set # CONFIG_TOUCHSCREEN_TPS6507X is not set -# CONFIG_INPUT_MISC is not set +CONFIG_INPUT_MISC=y +# CONFIG_INPUT_AD714X is not set +# CONFIG_INPUT_MMA8450 is not set +# CONFIG_INPUT_MPU3050 is not set +# CONFIG_INPUT_KXTJ9 is not set +# CONFIG_INPUT_UINPUT is not set +# CONFIG_INPUT_PCF8574 is not set +CONFIG_INPUT_PWM_BEEPER=y +# CONFIG_INPUT_GPIO_ROTARY_ENCODER is not set +# CONFIG_INPUT_ADXL34X is not set +# CONFIG_INPUT_CMA3000 is not set # # Hardware I/O ports diff --git a/configs/platform-friendlyarm-mini6410/patches/linux-3.1/add_buzzer_support.diff b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/add_buzzer_support.diff new file mode 100644 index 0000000..9b566a2 --- /dev/null +++ b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/add_buzzer_support.diff @@ -0,0 +1,52 @@ +Author: Juergen Beisert <jbe@pengutronix.de> +Subject: Add support for the onboard buzzer + +Signed-off-by: Juergen Beisert <jbe@pengutronix.de> + +--- + arch/arm/mach-s3c64xx/mach-mini6410.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +Index: linux-3.1/arch/arm/mach-s3c64xx/mach-mini6410.c +=================================================================== +--- linux-3.1.orig/arch/arm/mach-s3c64xx/mach-mini6410.c ++++ linux-3.1/arch/arm/mach-s3c64xx/mach-mini6410.c +@@ -438,6 +438,15 @@ static struct platform_device s3c6410_ir + .resource = &s3c6410_irom_resource, + }; + ++static struct platform_device mini6410_buzzer_device = { ++ .name = "pwm-beeper", ++ .id = -1, ++ .dev = { ++ .parent = &s3c_device_timer[0].dev, ++ .platform_data = (void *)0, /* channel 0 */ ++ }, ++}; ++ + static struct platform_device *mini6410_devices[] __initdata = { + &mini6410_device_eth, + &s3c_device_hsmmc0, +@@ -451,10 +460,12 @@ static struct platform_device *mini6410_ + &mini6410_leds, + &s3c_device_adc, + &s3c_device_ts, ++ &s3c_device_timer[0], + &s3c_device_timer[1], + &s3c_device_hwmon, + &mini6410_backlight_device, + &s3c6410_irom, ++ &mini6410_buzzer_device, + }; + + static void __init mini6410_map_io(void) +@@ -656,6 +667,9 @@ static void __init mini6410_machine_init + mini6410_mmc_init(); + mini6410_sdio_init(); + ++ /* PWM to the buzzer */ ++ s3c_gpio_cfgpin(S3C64XX_GPF(14), S3C_GPIO_SFN(2)); ++ + platform_add_devices(mini6410_devices, ARRAY_SIZE(mini6410_devices)); + } + diff --git a/configs/platform-friendlyarm-mini6410/patches/linux-3.1/fix_pwm.diff b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/fix_pwm.diff new file mode 100644 index 0000000..4be3f60 --- /dev/null +++ b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/fix_pwm.diff @@ -0,0 +1,28 @@ +From: Juergen Beisert <jbe@pengutronix.de> +Subject: samsung-plat: Avoid division by zero + +The pwm-beeper driver crashes the PWM driver by calling with a period time of +zero nanoseconds. + +Signed-off-by: Juergen Beisert <jbe@pengutronix.de> + +--- + arch/arm/plat-samsung/pwm.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +Index: linux-3.1/arch/arm/plat-samsung/pwm.c +=================================================================== +--- linux-3.1.orig/arch/arm/plat-samsung/pwm.c ++++ linux-3.1/arch/arm/plat-samsung/pwm.c +@@ -188,7 +188,10 @@ int pwm_config(struct pwm_device *pwm, i + tcmp = __raw_readl(S3C2410_TCMPB(pwm->pwm_id)); + tcnt = __raw_readl(S3C2410_TCNTB(pwm->pwm_id)); + +- period = NS_IN_HZ / period_ns; ++ if (period_ns) ++ period = NS_IN_HZ / period_ns; ++ else ++ period = 0; + + pwm_dbg(pwm, "duty_ns=%d, period_ns=%d (%lu)\n", + duty_ns, period_ns, period); diff --git a/configs/platform-friendlyarm-mini6410/patches/linux-3.1/series b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/series index 94dd71a..c8e68f2 100644 --- a/configs/platform-friendlyarm-mini6410/patches/linux-3.1/series +++ b/configs/platform-friendlyarm-mini6410/patches/linux-3.1/series @@ -53,4 +53,8 @@ enable_tcm_support.diff add_sd_card_support.diff add_sdio_card_support.diff +# add Mini6410 buzzer +fix_pwm.diff +add_buzzer_support.diff + set-marker.diff diff --git a/configs/platform-friendlyarm-mini6410/projectroot/lib/udev/rules.d/10-mini2440.rules b/configs/platform-friendlyarm-mini6410/projectroot/lib/udev/rules.d/10-mini2440.rules index 419d6a8..8f63a3b 100644 --- a/configs/platform-friendlyarm-mini6410/projectroot/lib/udev/rules.d/10-mini2440.rules +++ b/configs/platform-friendlyarm-mini6410/projectroot/lib/udev/rules.d/10-mini2440.rules @@ -3,3 +3,4 @@ # SUBSYSTEMS=="input", KERNELS=="input[0-9]*", ATTRS{name}=="gpio-keys", SYMLINK+="input/buttons" SUBSYSTEMS=="input", KERNELS=="input[0-9]*", ATTRS{name}=="S3C24XX TouchScreen", SYMLINK+="input/touchscreen" +SUBSYSTEMS=="input", KERNELS=="input[0-9]*", ATTRS{name}=="pwm-beeper", SYMLINK+="input/beeper" |