4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
9 * See the COPYING file in the top-level directory.
15 #include <sys/types.h>
17 #include <linux/input.h>
22 #include "plat_gp2x.h"
25 int default_cpu_clock;
28 static const char * const caanoo_keys[KEY_MAX + 1] = {
29 [0 ... KEY_MAX] = NULL,
32 [KEY_RIGHT] = "Right",
47 /* to be filled by mmsp2/pollux _init */
48 static int sound_rates[] = { 8000, 11025, 16000, 22050, 32000, 44100, 53000, -1 };
49 struct plat_target plat_target = { .sound_rates = sound_rates };
51 int plat_target_init(void)
61 default_cpu_clock = 200;
62 gp2x_dev_id = GP2X_DEV_GP2X;
66 default_cpu_clock = 533;
67 f = fopen("/dev/accel", "rb");
69 printf("detected Caanoo\n");
70 gp2x_dev_id = GP2X_DEV_CAANOO;
74 printf("detected Wiz\n");
75 gp2x_dev_id = GP2X_DEV_WIZ;
79 printf("could not recognize SoC.\n");
86 /* to be called after in_probe */
87 void plat_target_setup_input(void)
89 if (gp2x_dev_id == GP2X_DEV_CAANOO)
90 in_set_config(in_name_to_id("evdev:pollux-analog"),
92 caanoo_keys, sizeof(caanoo_keys));
95 void plat_target_finish(void)