1
0
Fork 0
forked from len0rd/rockbox

HDD1630/HDD6330/SA9200: Integration of the clicker with the "Keyclick" menu.

Change-Id: Ieb26f2252c1f2613cc9bd83c8349f49113f46d87
This commit is contained in:
Szymon Dziok 2014-11-08 21:12:24 +01:00
parent 73a780265a
commit bcca111438
9 changed files with 99 additions and 54 deletions

View file

@ -944,6 +944,7 @@ target/arm/sandisk/sansa-view/powermgmt-view.c
#ifdef PHILIPS_SA9200 #ifdef PHILIPS_SA9200
#ifndef BOOTLOADER #ifndef BOOTLOADER
drivers/synaptics-mep.c drivers/synaptics-mep.c
target/arm/philips/piezo.c
#endif /* BOOTLOADER */ #endif /* BOOTLOADER */
target/arm/philips/sa9200/backlight-sa9200.c target/arm/philips/sa9200/backlight-sa9200.c
target/arm/philips/sa9200/button-sa9200.c target/arm/philips/sa9200/button-sa9200.c
@ -956,6 +957,7 @@ target/arm/philips/sa9200/powermgmt-sa9200.c
#if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330) #if defined(PHILIPS_HDD1630) || defined(PHILIPS_HDD6330)
#ifndef BOOTLOADER #ifndef BOOTLOADER
drivers/synaptics-mep.c drivers/synaptics-mep.c
target/arm/philips/piezo.c
#endif /* BOOTLOADER */ #endif /* BOOTLOADER */
target/arm/philips/power-hdd.c target/arm/philips/power-hdd.c
target/arm/philips/fmradio_i2c-hdd.c target/arm/philips/fmradio_i2c-hdd.c

View file

@ -77,6 +77,8 @@
#define CONFIG_KEYPAD PHILIPS_HDD1630_PAD #define CONFIG_KEYPAD PHILIPS_HDD1630_PAD
#define HAVE_HARDWARE_CLICK
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -77,6 +77,8 @@
#define CONFIG_KEYPAD PHILIPS_HDD6330_PAD #define CONFIG_KEYPAD PHILIPS_HDD6330_PAD
#define HAVE_HARDWARE_CLICK
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -60,6 +60,8 @@
#define CONFIG_KEYPAD PHILIPS_SA9200_PAD #define CONFIG_KEYPAD PHILIPS_SA9200_PAD
#define HAVE_HARDWARE_CLICK
/* Define this to enable morse code input */ /* Define this to enable morse code input */
#define HAVE_MORSE_INPUT #define HAVE_MORSE_INPUT

View file

@ -29,18 +29,6 @@
static int int_btn = BUTTON_NONE; static int int_btn = BUTTON_NONE;
/*
* Generate a click sound from the player (not in headphones yet)
* TODO: integrate this with the "key click" option
*/
static void button_click(void)
{
GPO32_ENABLE |= 0x2000;
GPO32_VAL |= 0x2000;
udelay(1000);
GPO32_VAL &= ~0x2000;
}
#ifndef BOOTLOADER #ifndef BOOTLOADER
void button_init_device(void) void button_init_device(void)
{ {
@ -59,7 +47,7 @@ void button_int(void)
int_btn = BUTTON_NONE; int_btn = BUTTON_NONE;
val = touchpad_read_device(data, 4); val = touchpad_read_device(data, 4);
if (val == MEP_BUTTON_HEADER) if (val == MEP_BUTTON_HEADER)
{ {
/* Buttons packet */ /* Buttons packet */
@ -96,7 +84,6 @@ bool button_hold(void)
*/ */
int button_read_device(void) int button_read_device(void)
{ {
static int btn_old = BUTTON_NONE;
int btn = int_btn; int btn = int_btn;
/* Hold */ /* Hold */
@ -111,11 +98,6 @@ int button_read_device(void)
if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST; if (!(GPIOD_INPUT_VAL & 0x20)) btn |= BUTTON_PLAYLIST;
if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER; if (!(GPIOD_INPUT_VAL & 0x40)) btn |= BUTTON_POWER;
if ((btn != btn_old) && (btn != BUTTON_NONE))
button_click();
btn_old = btn;
return btn; return btn;
} }

View file

@ -37,18 +37,6 @@ static int scroll_repeat = BUTTON_NONE;
#endif #endif
static int repeat = 0; static int repeat = 0;
/*
* Generate a click sound from the player (not in headphones yet)
* TODO: integrate this with the "key click" option
*/
static void button_click(void)
{
GPO32_ENABLE |= 0x2000;
GPO32_VAL |= 0x2000;
udelay(1000);
GPO32_VAL &= ~0x2000;
}
#ifndef BOOTLOADER #ifndef BOOTLOADER
void button_init_device(void) void button_init_device(void)
{ {
@ -142,7 +130,6 @@ bool button_hold(void)
*/ */
int button_read_device(void) int button_read_device(void)
{ {
static int btn_old = BUTTON_NONE;
int btn = int_btn; int btn = int_btn;
/* Hold */ /* Hold */
@ -167,11 +154,6 @@ int button_read_device(void)
btn = BUTTON_NONE; btn = BUTTON_NONE;
} }
if ((btn != btn_old) && (btn != BUTTON_NONE))
button_click();
btn_old = btn;
return btn; return btn;
} }

View file

@ -0,0 +1,67 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2014 Szymon Dziok
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
#include "system.h"
#include "kernel.h"
#include "piezo.h"
void piezo_hw_voltage_on(void)
{
#ifndef SIMULATOR
#if defined(PHILIPS_SA9200)
GPIOF_ENABLE |= 0x08;
GPIOF_OUTPUT_VAL |= 0x08;
GPIOF_OUTPUT_EN |= 0x08;
#else
GPO32_ENABLE |= 0x2000;
GPO32_VAL |= 0x2000;
#endif /* PHILIPS_SA9200 */
#endif
}
void piezo_hw_voltage_off(void)
{
#ifndef SIMULATOR
#if defined(PHILIPS_SA9200)
GPIOF_OUTPUT_VAL &= ~0x08;
#else
GPO32_VAL &= ~0x2000;
#endif /* PHILIPS_SA9200 */
#endif
}
void piezo_init(void)
{
}
void piezo_button_beep(bool beep, bool force)
{
/* hw can only do a click */
(void)beep;
(void)force;
piezo_hw_voltage_on();
udelay(1000);
piezo_hw_voltage_off();
}

View file

@ -0,0 +1,23 @@
/***************************************************************************
* __________ __ ___.
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
* \/ \/ \/ \/ \/
* $Id$
*
* Copyright (C) 2014 Szymon Dziok
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
* KIND, either express or implied.
*
****************************************************************************/
void piezo_init(void);
void piezo_button_beep(bool beep, bool force);

View file

@ -29,19 +29,6 @@
static int int_btn = BUTTON_NONE; static int int_btn = BUTTON_NONE;
/*
* Generate a click sound from the player (not in headphones yet)
* TODO: integrate this with the "key click" option
*/
static void button_click(void)
{
GPIOF_ENABLE |= 0x08;
GPIOF_OUTPUT_VAL |= 0x08;
GPIOF_OUTPUT_EN |= 0x08;
udelay(1000);
GPIOF_OUTPUT_VAL &= ~0x08;
}
#ifndef BOOTLOADER #ifndef BOOTLOADER
static bool hold_button_old = false; static bool hold_button_old = false;
@ -148,7 +135,6 @@ bool button_hold(void)
*/ */
int button_read_device(void) int button_read_device(void)
{ {
static int btn_old = BUTTON_NONE;
int btn = int_btn; int btn = int_btn;
bool hold = !(GPIOL_INPUT_VAL & 0x40); bool hold = !(GPIOL_INPUT_VAL & 0x40);
@ -168,9 +154,6 @@ int button_read_device(void)
if (!(GPIOF_INPUT_VAL & 0x10)) btn |= BUTTON_VOL_UP; if (!(GPIOF_INPUT_VAL & 0x10)) btn |= BUTTON_VOL_UP;
if (!(GPIOF_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN; if (!(GPIOF_INPUT_VAL & 0x04)) btn |= BUTTON_VOL_DOWN;
if ((btn != btn_old) && (btn != BUTTON_NONE)) button_click();
btn_old = btn;
return btn; return btn;
} }