summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c')
-rw-r--r--firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c66
1 files changed, 10 insertions, 56 deletions
diff --git a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
index f6efe6d6a8..1b3a529f2d 100644
--- a/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
+++ b/firmware/target/arm/imx233/sansa-fuzeplus/button-fuzeplus.c
@@ -28,59 +28,6 @@
28#include "string.h" 28#include "string.h"
29 29
30#ifndef BOOTLOADER 30#ifndef BOOTLOADER
31static void i2c_scl_dir(bool out)
32{
33 imx233_enable_gpio_output(0, 30, out);
34}
35
36static void i2c_sda_dir(bool out)
37{
38 imx233_enable_gpio_output(0, 31, out);
39}
40
41static void i2c_scl_out(bool high)
42{
43 imx233_set_gpio_output(0, 30, high);
44}
45
46static void i2c_sda_out(bool high)
47{
48 imx233_set_gpio_output(0, 31, high);
49}
50
51static bool i2c_scl_in(void)
52{
53 return imx233_get_gpio_input_mask(0, 1 << 30);
54}
55
56static bool i2c_sda_in(void)
57{
58 return imx233_get_gpio_input_mask(0, 1 << 31);
59}
60
61static void i2c_delay(int d)
62{
63 udelay(d);
64}
65
66struct i2c_interface btn_i2c =
67{
68 .scl_dir = i2c_scl_dir,
69 .sda_dir = i2c_sda_dir,
70 .scl_out = i2c_scl_out,
71 .sda_out = i2c_sda_out,
72 .scl_in = i2c_scl_in,
73 .sda_in = i2c_sda_in,
74 .delay = i2c_delay,
75 .delay_hd_sta = 4,
76 .delay_hd_dat = 5,
77 .delay_su_dat = 1,
78 .delay_su_sto = 4,
79 .delay_su_sta = 5,
80 .delay_thigh = 4
81};
82
83int rmi_i2c_bus = -1;
84 31
85void button_debug_screen(void) 32void button_debug_screen(void)
86{ 33{
@@ -221,9 +168,6 @@ void button_debug_screen(void)
221 168
222void button_init_device(void) 169void button_init_device(void)
223{ 170{
224 rmi_i2c_bus = i2c_add_node(&btn_i2c);
225 rmi_init(rmi_i2c_bus, 0x40);
226
227 /* Synaptics TouchPad information: 171 /* Synaptics TouchPad information:
228 * - product id: 1533 172 * - product id: 1533
229 * - nr function: 1 (0x10 = 2D touchpad) 173 * - nr function: 1 (0x10 = 2D touchpad)
@@ -244,7 +188,17 @@ void button_init_device(void)
244 * - Resolution: 82 188 * - Resolution: 82
245 * 189 *
246 * ATTENTION line: B0P27 asserted low 190 * ATTENTION line: B0P27 asserted low
191 *
192 * The B0P26 line seems to be related to the touchpad
247 */ 193 */
194
195 /* for touchpad ? */
196 imx233_set_pin_function(0, 26, PINCTRL_FUNCTION_GPIO);
197 imx233_enable_gpio_output(0, 26, false);
198 imx233_set_pin_drive_strength(0, 26, PINCTRL_DRIVE_8mA);
199
200 rmi_init(0x40);
201
248 rmi_write_single(RMI_2D_SENSITIVITY_ADJ, 5); 202 rmi_write_single(RMI_2D_SENSITIVITY_ADJ, 5);
249 rmi_write_single(RMI_2D_GESTURE_SETTINGS, 203 rmi_write_single(RMI_2D_GESTURE_SETTINGS,
250 RMI_2D_GESTURE_PRESS_TIME_300MS | 204 RMI_2D_GESTURE_PRESS_TIME_300MS |