Skip to content

Commit

Permalink
ronetix-pm9g45: Added new machine, with kernel 2.6.30.
Browse files Browse the repository at this point in the history
  • Loading branch information
likewise committed Feb 21, 2011
1 parent 78be426 commit 9d4875f
Show file tree
Hide file tree
Showing 15 changed files with 45,021 additions and 0 deletions.
22 changes: 22 additions & 0 deletions conf/machine/ronetix-pm9g45.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#@TYPE: Machine
#@Name: Ronetix SAM9G45
#@DESCRIPTION: Machine configuration for Ronetix module with AT91SAM9G45 processor

include conf/machine/include/at91-2.6.30.inc
include conf/machine/include/at91-lcd.inc

#PREFERRED_VERSION_linux = "2.6.30"

# Has linux config file in OpenEmbedded
#
LINUX26_DEFCONFIG = "at91sam9g45ek_defconfig"

# Supported u-boot machines
UBOOT_MACHINE = "at91sam9m10g45ek_dataflash_cs0_config"
#UBOOT_MACHINE = "icnova_arm9sodimm_config"
UBOOT_ENTRYPOINT = "0x70008000"

AT91BOOTSTRAP_BOARD = "at91sam9g45df at91sam9g45ek at91sam9g45nf"

MACHINE_FEATURES += "usbhost"

Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
From 84325d6118849188bd765933e0f2db6795df9756 Mon Sep 17 00:00:00 2001
From: Asen Dimov <dimov@ronetix.at>
Date: Tue, 2 Mar 2010 00:58:51 +0200
Subject: [PATCH] ads7846 .c and .h add swap_xy

---
drivers/input/touchscreen/ads7846.c | 24 ++++++++++++++++++++----
include/linux/spi/ads7846.h | 1 +
2 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c
index 2b01e56..09c8109 100644
--- a/drivers/input/touchscreen/ads7846.c
+++ b/drivers/input/touchscreen/ads7846.c
@@ -83,6 +83,7 @@ struct ads7846_packet {
struct ads7846 {
struct input_dev *input;
char phys[32];
+ char name[32];

struct spi_device *spi;

@@ -97,6 +98,8 @@ struct ads7846 {
u16 x_plate_ohms;
u16 pressure_max;

+ bool swap_xy;
+
struct ads7846_packet *packet;

struct spi_transfer xfer[18];
@@ -599,6 +602,10 @@ static void ads7846_rx(void *ads)
dev_dbg(&ts->spi->dev, "DOWN\n");
#endif
}
+
+ if (ts->swap_xy)
+ swap(x, y);
+
input_report_abs(input, ABS_X, x);
input_report_abs(input, ABS_Y, y);
input_report_abs(input, ABS_PRESSURE, Rt);
@@ -917,6 +924,7 @@ static int __devinit ads7846_probe(struct spi_device *spi)
ts->spi = spi;
ts->input = input_dev;
ts->vref_mv = pdata->vref_mv;
+ ts->swap_xy = pdata->swap_xy;

hrtimer_init(&ts->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
ts->timer.function = ads7846_timer;
@@ -958,8 +966,9 @@ static int __devinit ads7846_probe(struct spi_device *spi)
ts->wait_for_sync = pdata->wait_for_sync ? : null_wait_for_sync;

snprintf(ts->phys, sizeof(ts->phys), "%s/input0", dev_name(&spi->dev));
+ snprintf(ts->name, sizeof(ts->name), "ADS%d Touchscreen", ts->model);

- input_dev->name = "ADS784x Touchscreen";
+ input_dev->name = ts->name;
input_dev->phys = ts->phys;
input_dev->dev.parent = &spi->dev;

@@ -1141,9 +1150,15 @@ static int __devinit ads7846_probe(struct spi_device *spi)

if (request_irq(spi->irq, ads7846_irq, IRQF_TRIGGER_FALLING,
spi->dev.driver->name, ts)) {
- dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
- err = -EBUSY;
- goto err_free_gpio;
+ dev_info(&spi->dev,
+ "trying pin change workaround on irq %d\n", spi->irq);
+ err = request_irq(spi->irq, ads7846_irq,
+ IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING,
+ spi->dev.driver->name, ts);
+ if (err) {
+ dev_dbg(&spi->dev, "irq %d busy?\n", spi->irq);
+ goto err_free_gpio;
+ }
}

err = ads784x_hwmon_register(spi, ts);
@@ -1241,3 +1256,4 @@ module_exit(ads7846_exit);

MODULE_DESCRIPTION("ADS7846 TouchScreen Driver");
MODULE_LICENSE("GPL");
+MODULE_ALIAS("spi:ads7846");
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 2ea2032..51948eb 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -17,6 +17,7 @@ struct ads7846_platform_data {
u16 vref_mv; /* external vref value, milliVolts */
bool keep_vref_on; /* set to keep vref on for differential
* measurements as well */
+ bool swap_xy; /* swap x and y axes */

/* Settling time of the analog signals; a function of Vcc and the
* capacitance on the X/Y drivers. If set to non-zero, two samples
--
1.5.5.6

Loading

0 comments on commit 9d4875f

Please sign in to comment.