linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: darkstar6262@gmail.com (Cory Maccarrone)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/5] [OMAP] htcherald: SPI register config, TSC2046 touchscreen
Date: Mon,  2 Aug 2010 08:29:33 -0700	[thread overview]
Message-ID: <1280762976-17284-3-git-send-email-darkstar6262@gmail.com> (raw)
In-Reply-To: <1280762976-17284-1-git-send-email-darkstar6262@gmail.com>

This change adds SPI bus support for the HTC Herald, and adds in
support for the TSC2046-based touchscreen attached to this
device (using the ADS7846 driver).

Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com>
---
 arch/arm/mach-omap1/board-htcherald.c |   35 +++++++++++++++++++++++++++++++++
 1 files changed, 35 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap1/board-htcherald.c b/arch/arm/mach-omap1/board-htcherald.c
index 2f0bb39..1b12b75 100644
--- a/arch/arm/mach-omap1/board-htcherald.c
+++ b/arch/arm/mach-omap1/board-htcherald.c
@@ -35,6 +35,8 @@
 #include <linux/i2c-gpio.h>
 #include <linux/htcpld.h>
 #include <linux/leds.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/ads7846.h>
 
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
@@ -63,6 +65,9 @@
 #define HTCHERALD_GPIO_SLIDE 174
 #define HTCHERALD_GIRQ_BTNS 141
 
+/* GPIO definitions for the touchscreen */
+#define HTCHERALD_GPIO_TS 76
+
 /* HTCPLD definitions */
 
 /*
@@ -429,6 +434,33 @@ static struct platform_device *devices[] __initdata = {
 };
 
 /*
+ * Touchscreen
+ */
+static const struct ads7846_platform_data htcherald_ts_platform_data = {
+	.model			= 7846,
+	.keep_vref_on		= 1,
+	.x_plate_ohms		= 496,
+	.gpio_pendown		= HTCHERALD_GPIO_TS,
+	.pressure_max		= 100000,
+	.pressure_min		= 5000,
+	.x_min			= 528,
+	.x_max			= 3760,
+	.y_min			= 624,
+	.y_max			= 3760,
+};
+
+static struct spi_board_info __initdata htcherald_spi_board_info[] = {
+	{
+		.modalias		= "ads7846",
+		.platform_data		= &htcherald_ts_platform_data,
+		.irq			= OMAP_GPIO_IRQ(HTCHERALD_GPIO_TS),
+		.max_speed_hz		= 2500000,
+		.bus_num		= 2,
+		.chip_select		= 1,
+	}
+};
+
+/*
  * Init functions from here on
  */
 
@@ -558,6 +590,9 @@ static void __init htcherald_init(void)
 	htcherald_usb_enable();
 	omap1_usb_init(&htcherald_usb_config);
 
+	spi_register_board_info(htcherald_spi_board_info,
+		ARRAY_SIZE(htcherald_spi_board_info));
+
 	omap_register_i2c_bus(1, 100, NULL, 0);
 
 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
-- 
1.6.0.4

  parent reply	other threads:[~2010-08-02 15:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-02 15:29 [PATCH 0/5] HTC Herald various device support Cory Maccarrone
2010-08-02 15:29 ` [PATCH 1/5] [OMAP] HTCHERALD: MMC, I2C, HTCPLD and related devices Cory Maccarrone
2010-08-04 10:10   ` Tony Lindgren
2010-08-08 17:39     ` [PATCH 1/5 v2] " Cory Maccarrone
2010-08-02 15:29 ` Cory Maccarrone [this message]
2010-08-04 10:12   ` [PATCH 2/5] [OMAP] htcherald: SPI register config, TSC2046 touchscreen Tony Lindgren
2010-08-02 15:29 ` [PATCH 3/5] [omap1] omap7xx clocks, mux, serial fixes Cory Maccarrone
2010-08-04 10:13   ` Tony Lindgren
2010-08-02 15:29 ` [PATCH 4/5] [omap1] Bluetooth device code common to HTC smartphones Cory Maccarrone
2010-08-04 10:15   ` Tony Lindgren
2010-08-08 17:28     ` Cory Maccarrone
2018-06-19 20:24       ` Tony Lindgren
2010-08-09 17:28         ` Cory Maccarrone
2010-08-10  6:36           ` Tony Lindgren
2010-08-02 15:29 ` [PATCH 5/5] [htcherald] Add board support for UARTs, bluetooth Cory Maccarrone
2010-08-04 10:16   ` 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=1280762976-17284-3-git-send-email-darkstar6262@gmail.com \
    --to=darkstar6262@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).