|
@@ -983,3 +983,91 @@ static struct platform_device *ap4evb_devices[] __initdata = {
|
|
|
|
|
|
static void __init hdmi_init_pm_clock(void)
|
|
|
{
|
|
|
+ struct clk *hdmi_ick = clk_get(&hdmi_device.dev, "ick");
|
|
|
+ int ret;
|
|
|
+ long rate;
|
|
|
+
|
|
|
+ if (IS_ERR(hdmi_ick)) {
|
|
|
+ ret = PTR_ERR(hdmi_ick);
|
|
|
+ pr_err("Cannot get HDMI ICK: %d\n", ret);
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = clk_set_parent(&sh7372_pllc2_clk, &sh7372_dv_clki_div2_clk);
|
|
|
+ if (ret < 0) {
|
|
|
+ pr_err("Cannot set PLLC2 parent: %d, %d users\n", ret, sh7372_pllc2_clk.usecount);
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ pr_debug("PLLC2 initial frequency %lu\n", clk_get_rate(&sh7372_pllc2_clk));
|
|
|
+
|
|
|
+ rate = clk_round_rate(&sh7372_pllc2_clk, 594000000);
|
|
|
+ if (rate < 0) {
|
|
|
+ pr_err("Cannot get suitable rate: %ld\n", rate);
|
|
|
+ ret = rate;
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ ret = clk_set_rate(&sh7372_pllc2_clk, rate);
|
|
|
+ if (ret < 0) {
|
|
|
+ pr_err("Cannot set rate %ld: %d\n", rate, ret);
|
|
|
+ goto out;
|
|
|
+ }
|
|
|
+
|
|
|
+ pr_debug("PLLC2 set frequency %lu\n", rate);
|
|
|
+
|
|
|
+ ret = clk_set_parent(hdmi_ick, &sh7372_pllc2_clk);
|
|
|
+ if (ret < 0)
|
|
|
+ pr_err("Cannot set HDMI parent: %d\n", ret);
|
|
|
+
|
|
|
+out:
|
|
|
+ if (!IS_ERR(hdmi_ick))
|
|
|
+ clk_put(hdmi_ick);
|
|
|
+}
|
|
|
+
|
|
|
+/* TouchScreen */
|
|
|
+#ifdef CONFIG_AP4EVB_QHD
|
|
|
+# define GPIO_TSC_IRQ GPIO_FN_IRQ28_123
|
|
|
+# define GPIO_TSC_PORT GPIO_PORT123
|
|
|
+#else /* WVGA */
|
|
|
+# define GPIO_TSC_IRQ GPIO_FN_IRQ7_40
|
|
|
+# define GPIO_TSC_PORT GPIO_PORT40
|
|
|
+#endif
|
|
|
+
|
|
|
+#define IRQ28 evt2irq(0x3380) /* IRQ28A */
|
|
|
+#define IRQ7 evt2irq(0x02e0) /* IRQ7A */
|
|
|
+static int ts_get_pendown_state(void)
|
|
|
+{
|
|
|
+ int val;
|
|
|
+
|
|
|
+ gpio_free(GPIO_TSC_IRQ);
|
|
|
+
|
|
|
+ gpio_request(GPIO_TSC_PORT, NULL);
|
|
|
+
|
|
|
+ gpio_direction_input(GPIO_TSC_PORT);
|
|
|
+
|
|
|
+ val = gpio_get_value(GPIO_TSC_PORT);
|
|
|
+
|
|
|
+ gpio_request(GPIO_TSC_IRQ, NULL);
|
|
|
+
|
|
|
+ return !val;
|
|
|
+}
|
|
|
+
|
|
|
+static int ts_init(void)
|
|
|
+{
|
|
|
+ gpio_request(GPIO_TSC_IRQ, NULL);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
+static struct tsc2007_platform_data tsc2007_info = {
|
|
|
+ .model = 2007,
|
|
|
+ .x_plate_ohms = 180,
|
|
|
+ .get_pendown_state = ts_get_pendown_state,
|
|
|
+ .init_platform_hw = ts_init,
|
|
|
+};
|
|
|
+
|
|
|
+static struct i2c_board_info tsc_device = {
|
|
|
+ I2C_BOARD_INFO("tsc2007", 0x48),
|
|
|
+ .type = "tsc2007",
|
|
|
+ .platform_data = &tsc2007_info,
|