summaryrefslogtreecommitdiff
path: root/firmware/target/arm/samsung/button-yh82x_yh92x.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/samsung/button-yh82x_yh92x.c')
-rw-r--r--firmware/target/arm/samsung/button-yh82x_yh92x.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/firmware/target/arm/samsung/button-yh82x_yh92x.c b/firmware/target/arm/samsung/button-yh82x_yh92x.c
index 2874a4a48a..ff8a580d2a 100644
--- a/firmware/target/arm/samsung/button-yh82x_yh92x.c
+++ b/firmware/target/arm/samsung/button-yh82x_yh92x.c
@@ -20,12 +20,15 @@
20 ****************************************************************************/ 20 ****************************************************************************/
21 21
22#include "system.h" 22#include "system.h"
23#include "kernel.h"
23#include "button.h" 24#include "button.h"
24#include "backlight.h" 25#include "backlight.h"
25#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) 26#if defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)
27#include "powermgmt.h"
26#include "adc.h" 28#include "adc.h"
27 29
28static int int_btn = BUTTON_NONE; 30static int int_btn = BUTTON_NONE;
31static unsigned int rec_switch;
29 32
30void button_init_device(void) 33void button_init_device(void)
31{ 34{
@@ -44,6 +47,9 @@ void button_init_device(void)
44 /* remote PLAY */ 47 /* remote PLAY */
45 GPIOD_ENABLE |= 0x02; 48 GPIOD_ENABLE |= 0x02;
46 GPIOD_OUTPUT_EN &= ~0x02; 49 GPIOD_OUTPUT_EN &= ~0x02;
50
51 /* current record switch state */
52 rec_switch = ~GPIOA_INPUT_VAL & 0x40;
47} 53}
48 54
49/* Remote buttons */ 55/* Remote buttons */
@@ -117,7 +123,24 @@ int button_read_device(void)
117 if (~GPIOA_INPUT_VAL & 0x08) btn |= BUTTON_DOWN; 123 if (~GPIOA_INPUT_VAL & 0x08) btn |= BUTTON_DOWN;
118 if (~GPIOA_INPUT_VAL & 0x02) btn |= BUTTON_FFWD; 124 if (~GPIOA_INPUT_VAL & 0x02) btn |= BUTTON_FFWD;
119 if (~GPIOA_INPUT_VAL & 0x80) btn |= BUTTON_REW; 125 if (~GPIOA_INPUT_VAL & 0x80) btn |= BUTTON_REW;
126#if defined(SAMSUNG_YH820)
120 if (~GPIOA_INPUT_VAL & 0x40) btn |= BUTTON_REC; 127 if (~GPIOA_INPUT_VAL & 0x40) btn |= BUTTON_REC;
128#else
129 if ((~GPIOA_INPUT_VAL & 0x40) != rec_switch)
130 {
131 if (rec_switch) {
132 queue_post(&button_queue,BUTTON_REC_SW_OFF,0);
133 queue_post(&button_queue,BUTTON_REC_SW_OFF|BUTTON_REL,0);
134 }
135 else {
136 queue_post(&button_queue,BUTTON_REC_SW_ON,0);
137 queue_post(&button_queue,BUTTON_REC_SW_ON|BUTTON_REL,0);
138 }
139 rec_switch = ~GPIOA_INPUT_VAL & 0x40;
140 backlight_on();
141 reset_poweroff_timer();
142 }
143#endif
121#if defined(SAMSUNG_YH820) 144#if defined(SAMSUNG_YH820)
122 if ( GPIOB_INPUT_VAL & 0x80) btn |= BUTTON_PLAY; 145 if ( GPIOB_INPUT_VAL & 0x80) btn |= BUTTON_PLAY;
123#elif defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925) 146#elif defined(SAMSUNG_YH920) || defined(SAMSUNG_YH925)