From: Tony Lindgren <tony@atomide.com>
To: Steve Sakoman <sakoman@gmail.com>
Cc: "linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 2/2] OMAP3 EVM: add touchscreen support
Date: Fri, 2 May 2008 16:15:38 -0700 [thread overview]
Message-ID: <20080502231537.GW8981@atomide.com> (raw)
In-Reply-To: <5e088bd90804301232k5a442506oc9f355c0716add43@mail.gmail.com>
Hi,
This patch should be first one in the series as you cannot really
enable it in the .config before this patch.
Also see some comments below.
* Steve Sakoman <sakoman@gmail.com> [080430 12:35]:
> From: Steve Sakoman <steve@sakoman.com>
>
> Add touchscreen support for OMAP3 EVM
>
> Signed-off-by: Steve Sakoman <steve@sakoman.com>
> ---
> arch/arm/mach-omap2/board-omap3evm.c | 42 +++++++++++++++++++++++++++++
> include/asm-arm/arch-omap/board-omap3evm.h | 1
> 2 files changed, 43 insertions(+)
> diff -uprN -X a/Documentation/dontdiff
> a/arch/arm/mach-omap2/board-omap3evm.c
> b/arch/arm/mach-omap2/board-omap3evm.c
> --- a/arch/arm/mach-omap2/board-omap3evm.c 2008-04-28 21:03:22.000000000 -0700
> +++ b/arch/arm/mach-omap2/board-omap3evm.c 2008-04-28 21:16:35.000000000 -0700
> @@ -19,6 +19,8 @@
> #include <linux/err.h>
> #include <linux/clk.h>
> #include <linux/io.h>
> +#include <linux/spi/spi.h>
> +#include <linux/spi/ads7846.h>
>
> #include <asm/hardware.h>
> #include <asm/mach-types.h>
> @@ -31,6 +33,7 @@
> #include <asm/arch/usb-musb.h>
> #include <asm/arch/usb-ehci.h>
> #include <asm/arch/common.h>
> +#include <asm/arch/mcspi.h>
>
> static struct omap_uart_config omap3_evm_uart_config __initdata = {
> .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
> @@ -65,6 +68,44 @@
> .id = -1,
> };
>
> +static void ads7846_dev_init(void)
> +{
> + if (omap_request_gpio(TS_GPIO) < 0)
> + printk(KERN_ERR "can't get ads7846 pen down GPIO\n");
> +
> + omap_set_gpio_direction(TS_GPIO, 1);
> +
> + omap_set_gpio_debounce(TS_GPIO, 1);
> + omap_set_gpio_debounce_time(TS_GPIO, 0xa);
> +}
> +
> +static int ads7846_get_pendown_state(void)
> +{
> + return !omap_get_gpio_datain(TS_GPIO);
> +}
> +
> +struct ads7846_platform_data ads7846_config = {
> + .get_pendown_state = ads7846_get_pendown_state,
> + .keep_vref_on = 1,
> +};
> +
> +static struct omap2_mcspi_device_config ads7846_mcspi_config = {
> + .turbo_mode = 0,
> + .single_channel = 1, /* 0: slave, 1: master */
> +};
> +
> +struct spi_board_info omap3evm_spi_board_info[] = {
> + [0] = {
> + .modalias = "ads7846",
> + .bus_num = 1,
> + .chip_select = 0,
> + .max_speed_hz = 1500000,
> + .controller_data = &ads7846_mcspi_config,
> + .irq = OMAP_GPIO_IRQ(TS_GPIO),
> + .platform_data = &ads7846_config,
> + },
> +};
> +
> static void __init omap3_evm_init_irq(void)
> {
> omap2_init_common_hw();
> @@ -90,6 +90,10 @@ static void __init omap3_evm_init(void)
> platform_add_devices(omap3_evm_devices, ARRAY_SIZE(omap3_evm_devices));
> omap_board_config = omap3_evm_config;
> omap_board_config_size = ARRAY_SIZE(omap3_evm_config);
> +
> + spi_register_board_info(omap3evm_spi_board_info,
> + ARRAY_SIZE(omap3evm_spi_board_info));
> +
> omap_serial_init();
> hsmmc_init();
> usb_musb_init();
> @@ -95,6 +136,7 @@
> usb_musb_init();
> usb_ehci_init();
> omap3evm_flash_init();
> + ads7846_dev_init();
> }
>
> arch_initcall(omap3_evm_i2c_init);
> diff -uprN -X a/Documentation/dontdiff
> a/include/asm-arm/arch-omap/board-omap3evm.h
> b/include/asm-arm/arch-omap/board-omap3evm.h
> --- a/include/asm-arm/arch-omap/board-omap3evm.h 2008-04-28
> 21:03:19.000000000 -0700
> +++ b/include/asm-arm/arch-omap/board-omap3evm.h 2008-04-28
> 21:11:29.000000000 -0700
> @@ -31,6 +31,7 @@
>
> extern void omap3evm_flash_init(void);
>
> +#define TS_GPIO 175
This should be OMAP3_EVM_TS_GPIO or similar. Otherwise things will
get redefined when compiling in support for multiple boards.
> #define TWL4030_IRQNUM INT_34XX_SYS_NIRQ
And this should really be OMAP3_TWL4030_IRQNUM defined in 34xx.h.
Tony
>
> #define ONENAND_MAP 0x20000000
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2008-05-02 23:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-04-30 19:32 [PATCH 2/2] OMAP3 EVM: add touchscreen support Steve Sakoman
2008-05-02 23:15 ` Tony Lindgren [this message]
2008-05-06 14:16 ` Steve Sakoman
2008-05-06 14:27 ` Tony Lindgren
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080502231537.GW8981@atomide.com \
--to=tony@atomide.com \
--cc=linux-omap@vger.kernel.org \
--cc=sakoman@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox