My Opera is closing 3rd of March

My world

BeagleBoard Rev C4 and 7" TFT LCD frame + touch

This touch screen does have Android Froyo source included. However, it will be better if it can work with the newer version (GingerBread).

After reading the customized Froyo source, I finally made this touchscreen work with my BeagleBoard Rev C4 and hope it will be useful for people who has troubles with this touch screen like me. smile.




At first, you should have Android GingerBread source from rowboat, which can downloaded here

Some problems which you must face are wrong screen resolution and touchscreen.

1. For wrong screen resolution, it required to define 800x600 screen resolution support. Here is changes:


*************** *** 282,287 **** --- 282,291 ----
/* 720x480 @ 60 Hz, (480P) */
NULL, 60, 720, 480, 35838, 96, 24, 32, 10, 96, 3,
0, FB_VMODE_NONINTERLACED
+ }, { +
/* 800x480 @60 Hz, ATO70TN83 LCD */
+ NULL, 60, 800, 480, KHZ2PICOS(30000), 40, 40, 13, 29, 48, 3,
+ 0, FB_VMODE_NONINTERLACED }, };



In addition, boot arguments is changed for booting from DVI instead of from LCD for default. Here is my boot arguments:

setenv bootargs 'console=ttyS0,115200n8 androidboot.console=ttyS0 mem=256M root=/dev/mmcblk0p2 rw rootfstype=ext3 rootdelay=1 init=/init ip=off omap_vout.vid1_static_vrfb_alloc=y vram=8M omapfb.vram=0:8M omapdss.def_disp=dvi omapfb.mode=dvi:800x480MR-16@60'







2. For touchscreen, SPI configuration ( some changes in file board-omap3beagle.c ), touch calibrate ( ads7846.c) and config must be edited.

Please read for more details at elinux.org/BeagleBoard/SPI and Porting Guides.

2.1. SPI configuration:


Changes in /kernel/arch/arm/mach-omap2/board-omap3beagle.c

At first, you should configure Pinmux


+ static void __init omap3_beagle_config_mcspi3_mux(void)
+ {
+ // NOTE: Clock pins need to be in input mode
+ omap_mux_init_signal("sdmmc2_clk.mcspi3_clk", OMAP_PIN_INPUT);
+ omap_mux_init_signal("sdmmc2_dat3.mcspi3_cs0", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("sdmmc2_dat2.mcspi3_cs1", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("sdmmc2_cmd.mcspi3_simo", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("sdmmc2_dat0.mcspi3_somi", OMAP_PIN_INPUT_PULLUP);
+ }
+
+ static void __init omap3_beagle_config_mcspi4_mux(void)
+ {
+ // NOTE: Clock pins need to be in input mode
+ omap_mux_init_signal("mcbsp1_clkr.mcspi4_clk", OMAP_PIN_INPUT);
+ omap_mux_init_signal("mcbsp1_fsx.mcspi4_cs0", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("mcbsp1_dx.mcspi4_simo", OMAP_PIN_OUTPUT);
+ omap_mux_init_signal("mcbsp1_dr.mcspi4_somi", OMAP_PIN_INPUT_PULLUP);
+ }
+
+

#ifdef CONFIG_OMAP_MUX
static struct omap_board_mux board_mux[] __initdata = {
{ .reg_offset = OMAP_MUX_TERMINATOR },
+
+ #ifdef CONFIG_TOUCHSCREEN_ADS7846
+ OMAP3_MUX(SDMMC2_DAT1, OMAP_MUX_MODE4 | OMAP_PIN_INPUT_PULLUP |
+ OMAP_PIN_OFF_INPUT_PULLUP | OMAP_PIN_OFF_OUTPUT_LOW |
+ OMAP_PIN_OFF_WAKEUPENABLE),
+ #endif
+
};
#endif



and initialization:


static void __init omap3_beagle_init(void)
{

+ omap3_beagle_config_mcspi3_mux();
+ omap3_beagle_config_mcspi4_mux();

}



For configuring touch screen:



+
+ static struct omap2_mcspi_device_config ads7846_mcspi_config = {
+ .turbo_mode = 0,
+ .single_channel = 1, /* 0: slave, 1: master */
+ };
+
+ static int ads7846_get_pendown_state(void)
+ {
+ return !gpio_get_value(OMAP3_EVM_TS_GPIO);
+ }
+
+ struct ads7846_platform_data ads7846_config = {
+ .x_max = 0x0fff,
+ .y_max = 0x0fff,
+ .x_plate_ohms = 180,
+ .pressure_max = 255,
+ .debounce_max = 10,
+ .debounce_tol = 3,
+ .debounce_rep = 1,
+ .get_pendown_state = ads7846_get_pendown_state,
+ .keep_vref_on = 1,
+ .settle_delay_usecs = 150,
+ .wakeup = true,
+ };
+
+ struct spi_board_info omap3evm_spi_board_info[] = {
+ [0] = {
+ .modalias = "ads7846",
+ .bus_num = 3,
+ .chip_select = 0,
+ .max_speed_hz = 1500000,
+ .controller_data = &ads7846_mcspi_config,
+ .irq = OMAP_GPIO_IRQ(OMAP3_EVM_TS_GPIO),
+ .platform_data = &ads7846_config,
+ },
+ };
+
+ static void ads7846_dev_init(void)
+ {
+ printk("Initialize ads7846 touch screen controller\n");
+
+ if (gpio_request(OMAP3_EVM_TS_GPIO, "ADS7846 pendown") < 0)
+ printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
+
+ gpio_direction_input(OMAP3_EVM_TS_GPIO);
+
+ gpio_set_debounce(OMAP3_EVM_TS_GPIO, 0xa);
+ }
+
+ #else
+ static inline void __init ads7846_dev_init(void) { return; }
+ #endif
+




and initialization:


static void __init omap3_beagle_init(void)
{

+ spi_register_board_info(omap3evm_spi_board_info, ARRAY_SIZE(omap3evm_spi_board_info));\\\


+ ads7846_dev_init();

}



Other configuration:


static struct gpio_keys_button gpio_buttons[] = {
{
! .code = KEY_PROG1,
! .gpio = 4,
.desc = "user",
+ .active_low = false,
+ .wakeup = 1,
+ },
+ {
+ .code = KEY_PROG2,
+ .gpio = 137,
+ .desc = "s1",
+ .active_low = true,
.wakeup = 1,
},
+ {
+ .code = KEY_PROG3,
+ .gpio = 138,
+ .desc = "s2",
+ .active_low = true,
+ .wakeup = 1,
+ },
+
};




2.2. Touch calibrate and config are included in file.


Here is the patch.
Have fun !!!

















Comments

Unregistered user Thursday, November 17, 2011 4:27:41 AM

tricker writes: Cool! Can you play it with Angry Birds?

Unregistered user Thursday, February 2, 2012 9:15:33 AM

Sarasini writes: Hi, great post! I apply the patch but my touchscreen doesn't work. In dmesg I have: ads7846 spi3.0: touchscreen, irq 322 input: ADS7846 Touchscreen as /devices/platform/omap/omap2_mcspi.3/spi3.0/input/input0 If I do "cat /proc/interrupts" I see GPIO ads7846 incrementing. # getevent add device 1: /dev/input/event4 name: "HID 04d9:0499" could not get driver version for /dev/input/mouse2, Not a typewriter add device 2: /dev/input/event3 name: "Fake Touchscreen" could not get driver version for /dev/input/mouse1, Not a typewriter could not get driver version for /dev/input/mice, Not a typewriter add device 3: /dev/input/event2 name: "gpio-keys" add device 4: /dev/input/event0 name: "ADS7846 Touchscreen" could not get driver version for /dev/input/mouse0, Not a typewriter add device 5: /dev/input/event1 name: "twl4030_pwrbutton" I can see mouse events, but nothing for touch. How can I do? Thanks

Write a comment

New comments have been disabled for this post.

February 2014
M T W T F S S
January 2014March 2014
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28