Commit da82480d authored by Olof Johansson's avatar Olof Johansson

Merge tag 'pxa-for-4.13' of https://github.com/rjarzmik/linux into next/soc

This is the pxa changes for v4.13 cycle.

This cycle is a minor fixes one, with :
 - Coccinelle found improvements
 - magician getting touchscreen driver support.

* tag 'pxa-for-4.13' of https://github.com/rjarzmik/linux:
  ARM: pxa: Delete an error message for a failed memory allocation in pxa3xx_u2d_probe()
  ARM: pxa: Improve a size determination in pxa3xx_u2d_probe()
  ARM: pxa: Delete an error message for a failed memory allocation in pxa_pm_init()
  ARM: pxa: magician: Add support for ADS7846 touchscreen
Signed-off-by: default avatarOlof Johansson <olof@lixom.net>
parents 2b1ee306 ce3de60f
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#define GPIO10_MAGICIAN_GSM_IRQ 10 #define GPIO10_MAGICIAN_GSM_IRQ 10
#define GPIO11_MAGICIAN_GSM_OUT1 11 #define GPIO11_MAGICIAN_GSM_OUT1 11
#define GPIO13_MAGICIAN_CPLD_IRQ 13 #define GPIO13_MAGICIAN_CPLD_IRQ 13
#define GPIO14_MAGICIAN_TSC2046_CS 14
#define GPIO18_MAGICIAN_UNKNOWN 18 #define GPIO18_MAGICIAN_UNKNOWN 18
#define GPIO22_MAGICIAN_VIBRA_EN 22 #define GPIO22_MAGICIAN_VIBRA_EN 22
#define GPIO26_MAGICIAN_GSM_POWER 26 #define GPIO26_MAGICIAN_GSM_POWER 26
......
...@@ -54,6 +54,10 @@ ...@@ -54,6 +54,10 @@
#include "devices.h" #include "devices.h"
#include "generic.h" #include "generic.h"
#include <linux/spi/spi.h>
#include <linux/spi/pxa2xx_spi.h>
#include <linux/spi/ads7846.h>
static unsigned long magician_pin_config[] __initdata = { static unsigned long magician_pin_config[] __initdata = {
/* SDRAM and Static Memory I/O Signals */ /* SDRAM and Static Memory I/O Signals */
...@@ -85,7 +89,7 @@ static unsigned long magician_pin_config[] __initdata = { ...@@ -85,7 +89,7 @@ static unsigned long magician_pin_config[] __initdata = {
/* SSP 2 TSC2046 touchscreen */ /* SSP 2 TSC2046 touchscreen */
GPIO19_SSP2_SCLK, GPIO19_SSP2_SCLK,
GPIO14_SSP2_SFRM, MFP_CFG_OUT(GPIO14, AF0, DRIVE_HIGH), /* frame as GPIO */
GPIO89_SSP2_TXD, GPIO89_SSP2_TXD,
GPIO88_SSP2_RXD, GPIO88_SSP2_RXD,
...@@ -674,6 +678,37 @@ static struct platform_device bq24022 = { ...@@ -674,6 +678,37 @@ static struct platform_device bq24022 = {
}, },
}; };
/*
* fixed regulator for ads7846
*/
static struct regulator_consumer_supply ads7846_supply =
REGULATOR_SUPPLY("vcc", "spi2.0");
static struct regulator_init_data vads7846_regulator = {
.constraints = {
.valid_ops_mask = REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 1,
.consumer_supplies = &ads7846_supply,
};
static struct fixed_voltage_config vads7846 = {
.supply_name = "vads7846",
.microvolts = 3300000, /* probably */
.gpio = -EINVAL,
.startup_delay = 0,
.init_data = &vads7846_regulator,
};
static struct platform_device vads7846_device = {
.name = "reg-fixed-voltage",
.id = -1,
.dev = {
.platform_data = &vads7846,
},
};
/* /*
* Vcore regulator MAX1587A * Vcore regulator MAX1587A
*/ */
...@@ -851,6 +886,49 @@ static struct i2c_pxa_platform_data magician_i2c_power_info = { ...@@ -851,6 +886,49 @@ static struct i2c_pxa_platform_data magician_i2c_power_info = {
.fast_mode = 1, .fast_mode = 1,
}; };
/*
* Touchscreen
*/
static struct ads7846_platform_data ads7846_pdata = {
.model = 7846,
.x_plate_ohms = 317,
.y_plate_ohms = 500,
.pressure_max = 1023, /* with x plate ohms it will overflow 255 */
.debounce_max = 3, /* first readout is always bad */
.debounce_tol = 30,
.debounce_rep = 0,
.gpio_pendown = GPIO115_MAGICIAN_nPEN_IRQ,
.keep_vref_on = 1,
.wakeup = true,
.vref_delay_usecs = 100,
.penirq_recheck_delay_usecs = 100,
};
struct pxa2xx_spi_chip tsc2046_chip_info = {
.tx_threshold = 1,
.rx_threshold = 2,
.timeout = 64,
/* NOTICE must be GPIO, incompatibility with hw PXA SPI framing */
.gpio_cs = GPIO14_MAGICIAN_TSC2046_CS,
};
static struct pxa2xx_spi_master magician_spi_info = {
.num_chipselect = 1,
.enable_dma = 1,
};
static struct spi_board_info ads7846_spi_board_info[] __initdata = {
{
.modalias = "ads7846",
.bus_num = 2,
.max_speed_hz = 2500000,
.platform_data = &ads7846_pdata,
.controller_data = &tsc2046_chip_info,
.irq = PXA_GPIO_TO_IRQ(GPIO115_MAGICIAN_nPEN_IRQ),
},
};
/* /*
* Platform devices * Platform devices
*/ */
...@@ -865,6 +943,7 @@ static struct platform_device *devices[] __initdata = { ...@@ -865,6 +943,7 @@ static struct platform_device *devices[] __initdata = {
&power_supply, &power_supply,
&strataflash, &strataflash,
&leds_gpio, &leds_gpio,
&vads7846_device,
}; };
static struct gpio magician_global_gpios[] = { static struct gpio magician_global_gpios[] = {
...@@ -922,6 +1001,9 @@ static void __init magician_init(void) ...@@ -922,6 +1001,9 @@ static void __init magician_init(void)
} else } else
pr_err("LCD detection: CPLD mapping failed\n"); pr_err("LCD detection: CPLD mapping failed\n");
pxa2xx_set_spi_info(2, &magician_spi_info);
spi_register_board_info(ARRAY_AND_SIZE(ads7846_spi_board_info));
regulator_register_always_on(0, "power", pwm_backlight_supply, regulator_register_always_on(0, "power", pwm_backlight_supply,
ARRAY_SIZE(pwm_backlight_supply), 5000000); ARRAY_SIZE(pwm_backlight_supply), 5000000);
......
...@@ -107,10 +107,8 @@ static int __init pxa_pm_init(void) ...@@ -107,10 +107,8 @@ static int __init pxa_pm_init(void)
sleep_save = kmalloc_array(pxa_cpu_pm_fns->save_count, sleep_save = kmalloc_array(pxa_cpu_pm_fns->save_count,
sizeof(*sleep_save), sizeof(*sleep_save),
GFP_KERNEL); GFP_KERNEL);
if (!sleep_save) { if (!sleep_save)
printk(KERN_ERR "failed to alloc memory for pm save\n");
return -ENOMEM; return -ENOMEM;
}
suspend_set_ops(&pxa_pm_ops); suspend_set_ops(&pxa_pm_ops);
return 0; return 0;
......
...@@ -286,11 +286,9 @@ static int pxa3xx_u2d_probe(struct platform_device *pdev) ...@@ -286,11 +286,9 @@ static int pxa3xx_u2d_probe(struct platform_device *pdev)
struct resource *r; struct resource *r;
int err; int err;
u2d = kzalloc(sizeof(struct pxa3xx_u2d_ulpi), GFP_KERNEL); u2d = kzalloc(sizeof(*u2d), GFP_KERNEL);
if (!u2d) { if (!u2d)
dev_err(&pdev->dev, "failed to allocate memory\n");
return -ENOMEM; return -ENOMEM;
}
u2d->clk = clk_get(&pdev->dev, NULL); u2d->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(u2d->clk)) { if (IS_ERR(u2d->clk)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment