* [PATCH v3 16/26] ARM: pxa: magician: Fix support for Intel Strata NOR Flash
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
@ 2015-09-18 1:16 ` Petr Cvek
2015-09-18 1:17 ` [PATCH v3 17/26] ARM: pxa: magician: Fix wrongly enabled USB host ports Petr Cvek
` (9 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:16 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
Old definition for the physmap-flash driver is incomplete:
- Use of an EGPIO without previous request
- Missing the MTD partitions
This patch fixes it. Read functionality was tested on the machine with
board_id 0x3a. Writing was not tested.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 45 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 45 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 91b5ed0..8e8b122 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -788,20 +788,65 @@ static struct pxaohci_platform_data magician_ohci_info = {
* StrataFlash
*/
+static int magician_flash_init(struct platform_device *pdev)
+{
+ int ret = gpio_request(EGPIO_MAGICIAN_FLASH_VPP, "flash Vpp enable");
+
+ if (ret) {
+ pr_err("Cannot request flash enable GPIO (%i)\n", ret);
+ return ret;
+ }
+
+ ret = gpio_direction_output(EGPIO_MAGICIAN_FLASH_VPP, 1);
+ if (ret) {
+ pr_err("Cannot set direction for flash enable (%i)\n", ret);
+ gpio_free(EGPIO_MAGICIAN_FLASH_VPP);
+ }
+
+ return ret;
+}
+
static void magician_set_vpp(struct platform_device *pdev, int vpp)
{
gpio_set_value(EGPIO_MAGICIAN_FLASH_VPP, vpp);
}
+static void magician_flash_exit(struct platform_device *pdev)
+{
+ gpio_free(EGPIO_MAGICIAN_FLASH_VPP);
+}
+
static struct resource strataflash_resource = {
.start = PXA_CS0_PHYS,
.end = PXA_CS0_PHYS + SZ_64M - 1,
.flags = IORESOURCE_MEM,
};
+static struct mtd_partition magician_flash_parts[] = {
+ {
+ .name = "Bootloader",
+ .offset = 0x0,
+ .size = 0x40000,
+ .mask_flags = MTD_WRITEABLE, /* EXPERIMENTAL */
+ },
+ {
+ .name = "Linux Kernel",
+ .offset = 0x40000,
+ .size = MTDPART_SIZ_FULL,
+ },
+};
+
+/*
+ * physmap-flash driver
+ */
+
static struct physmap_flash_data strataflash_data = {
.width = 4,
+ .init = magician_flash_init,
.set_vpp = magician_set_vpp,
+ .exit = magician_flash_exit,
+ .parts = magician_flash_parts,
+ .nr_parts = ARRAY_SIZE(magician_flash_parts),
};
static struct platform_device strataflash = {
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 17/26] ARM: pxa: magician: Fix wrongly enabled USB host ports
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
2015-09-18 1:16 ` [PATCH v3 16/26] ARM: pxa: magician: Fix support for Intel Strata NOR Flash Petr Cvek
@ 2015-09-18 1:17 ` Petr Cvek
2015-09-18 1:18 ` [PATCH v3 18/26] ARM: pxa: magician: Add support for ADS7846 Petr Cvek
` (8 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:17 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
USB host ports on the HTC Magician are wrongly enabled. Port 1 is for
bluetooth and port 2 is for OTG (mux in the charger connector).
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 8e8b122..af8133a 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -780,8 +780,10 @@ static struct pxamci_platform_data magician_mci_info = {
static struct pxaohci_platform_data magician_ohci_info = {
.port_mode = PMM_PERPORT_MODE,
- .flags = ENABLE_PORT1 | ENABLE_PORT3 | POWER_CONTROL_LOW,
+ /* port1: CSR Bluetooth, port2: OTG with UDC */
+ .flags = ENABLE_PORT1 | ENABLE_PORT2 | POWER_CONTROL_LOW,
.power_budget = 0,
+ .power_on_delay = 100,
};
/*
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 18/26] ARM: pxa: magician: Add support for ADS7846
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
2015-09-18 1:16 ` [PATCH v3 16/26] ARM: pxa: magician: Fix support for Intel Strata NOR Flash Petr Cvek
2015-09-18 1:17 ` [PATCH v3 17/26] ARM: pxa: magician: Fix wrongly enabled USB host ports Petr Cvek
@ 2015-09-18 1:18 ` Petr Cvek
2015-09-18 1:18 ` [PATCH v3 19/26] ARM: pxa: magician: Add support for Omnivision OV9640 camera Petr Cvek
` (7 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:18 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
Add support for an ADS7846 touchscreen.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 86 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 86 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index af8133a..450f35f 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -28,6 +28,7 @@
#include <linux/pwm_backlight.h>
#include <linux/regulator/driver.h>
#include <linux/regulator/gpio-regulator.h>
+#include <linux/regulator/fixed.h>
#include <linux/regulator/machine.h>
#include <linux/usb/gpio_vbus.h>
#include <linux/i2c/pxa-i2c.h>
@@ -44,6 +45,10 @@
#include <linux/platform_data/irda-pxaficp.h>
#include <linux/platform_data/usb-ohci-pxa27x.h>
+#include <linux/spi/spi.h>
+#include <linux/spi/pxa2xx_spi.h>
+#include <linux/spi/ads7846.h>
+
#include "devices.h"
#include "generic.h"
@@ -748,6 +753,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,
+ },
+};
+
+/*
* MMC/SD
*/
@@ -879,6 +915,51 @@ static struct i2c_pxa_platform_data magician_i2c_power_info = {
};
/*
+ * Touchscreen
+ */
+
+static struct ads7846_platform_data ads7846_pdata = {
+ .model = 7846,
+ .x_min = 0,
+ .y_min = 0,
+ .x_max = 4096,
+ .y_max = 4096,
+ .x_plate_ohms = 180, /* for pressure in 0-255 */
+ .y_plate_ohms = 180,
+ .pressure_max = 255, /* up to 12bit sampling */
+ .debounce_max = 10,
+ .debounce_tol = 3,
+ .debounce_rep = 1,
+ .gpio_pendown = GPIO115_MAGICIAN_nPEN_IRQ,
+ .keep_vref_on = 1, /* FIXME, external Vref? */
+ .vref_delay_usecs = 100,
+ /* .wait_for_sync, GPIO77_LCD_BIAS low noise measure, latency! */
+};
+
+struct pxa2xx_spi_chip tsc2046_chip_info = {
+ .tx_threshold = 1,
+ .rx_threshold = 2,
+ .timeout = 64,
+ .gpio_cs = -1,
+};
+
+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 = 1857143,
+ .platform_data = &ads7846_pdata,
+ .controller_data = &tsc2046_chip_info,
+ .irq = PXA_GPIO_TO_IRQ(GPIO115_MAGICIAN_nPEN_IRQ),
+ },
+};
+
+/*
* Platform devices
*/
@@ -887,6 +968,7 @@ static struct platform_device *devices[] __initdata = {
&egpio,
&backlight,
&pasic3,
+ &vads7846_device,
&bq24022,
&gpio_vbus,
&power_supply,
@@ -944,6 +1026,10 @@ static void __init magician_init(void)
lcd_select ? &samsung_info : &toppoly_info);
} else
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));
+
}
MACHINE_START(MAGICIAN, "HTC Magician")
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 19/26] ARM: pxa: magician: Add support for Omnivision OV9640 camera
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (2 preceding siblings ...)
2015-09-18 1:18 ` [PATCH v3 18/26] ARM: pxa: magician: Add support for ADS7846 Petr Cvek
@ 2015-09-18 1:18 ` Petr Cvek
2015-09-18 1:19 ` [PATCH v3 20/26] ARM: pxa: magician: Add support for MAX1587A Vcore regulator Petr Cvek
` (6 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:18 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
This patch adds support for an OV9640 camera to the HTC Magician machine.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 61 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 450f35f..d844b9c 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -49,6 +49,9 @@
#include <linux/spi/pxa2xx_spi.h>
#include <linux/spi/ads7846.h>
+#include <linux/platform_data/camera-pxa.h>
+#include <media/soc_camera.h>
+
#include "devices.h"
#include "generic.h"
@@ -960,6 +963,60 @@ static struct spi_board_info ads7846_spi_board_info[] __initdata = {
};
/*
+ * SoC Camera for OV9640 chip
+ */
+
+static struct pxacamera_platform_data magician_pxacamera_pdata = {
+ .flags = PXA_CAMERA_MASTER | PXA_CAMERA_DATAWIDTH_8 |
+ PXA_CAMERA_PCLK_EN | PXA_CAMERA_MCLK_EN,
+ .mclk_10khz = 4800,
+};
+
+static int magician_camera_power(struct device *dev, int power)
+{
+ pr_debug("Camera power = %i\n", power);
+
+ gpio_set_value(GPIO116_MAGICIAN_nCAM_EN, !power);
+ mdelay(3);
+
+ return 0;
+}
+
+static int magician_camera_reset(struct device *dev)
+{
+ pr_debug("Camera reset\n");
+
+ gpio_set_value(GPIO57_MAGICIAN_CAM_RESET, 1);
+ mdelay(3);
+ gpio_set_value(GPIO57_MAGICIAN_CAM_RESET, 0);
+ mdelay(3);
+
+ return 0;
+}
+
+static struct i2c_board_info magician_camera_i2c_board_info = {
+ I2C_BOARD_INFO("ov9640", 0x30),
+ .flags = I2C_CLIENT_SCCB,
+};
+
+static struct soc_camera_link magician_camera_iclink = {
+ .bus_id = 0,
+ .flags = SOCAM_DATAWIDTH_8,
+ .i2c_adapter_id = 0,
+ .board_info = &magician_camera_i2c_board_info,
+ .power = magician_camera_power,
+ .reset = magician_camera_reset,
+};
+
+static struct platform_device magician_camera = {
+ .name = "soc-camera-pdrv",
+ .id = 0,
+ .dev = {
+ .platform_data = &magician_camera_iclink,
+ },
+};
+
+/*
* Platform devices
*/
@@ -974,6 +1031,7 @@ static struct platform_device *devices[] __initdata = {
&power_supply,
&strataflash,
&leds_gpio,
+ &magician_camera,
};
static struct gpio magician_global_gpios[] = {
@@ -984,6 +1042,8 @@ static struct gpio magician_global_gpios[] = {
{ GPIO106_MAGICIAN_LCD_DCDC_NRESET, GPIOF_OUT_INIT_LOW, "LCD DCDC nreset" },
{ GPIO104_MAGICIAN_LCD_VOFF_EN, GPIOF_OUT_INIT_LOW, "LCD VOFF enable" },
{ GPIO105_MAGICIAN_LCD_VON_EN, GPIOF_OUT_INIT_LOW, "LCD VON enable" },
+ { GPIO57_MAGICIAN_CAM_RESET, GPIOF_OUT_INIT_HIGH, "Camera reset" },
+ { GPIO116_MAGICIAN_nCAM_EN, GPIOF_OUT_INIT_HIGH, "Camera power" },
};
static void __init magician_init(void)
@@ -1030,6 +1090,7 @@ static void __init magician_init(void)
pxa2xx_set_spi_info(2, &magician_spi_info);
spi_register_board_info(ARRAY_AND_SIZE(ads7846_spi_board_info));
+ pxa_set_camera_info(&magician_pxacamera_pdata);
}
MACHINE_START(MAGICIAN, "HTC Magician")
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 20/26] ARM: pxa: magician: Add support for MAX1587A Vcore regulator
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (3 preceding siblings ...)
2015-09-18 1:18 ` [PATCH v3 19/26] ARM: pxa: magician: Add support for Omnivision OV9640 camera Petr Cvek
@ 2015-09-18 1:19 ` Petr Cvek
2015-09-18 1:19 ` [PATCH v3 21/26] ARM: pxa: magician: Add support for PXA27x UDC Petr Cvek
` (5 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:19 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
HTC Magician contains a MAX1587A voltage regulator for a Vcore supply.
The Vcore regulation is required for a CPU speed switching. This patch adds
declaration for the max1586 driver.
Notice:
- MAX1587A version does not support the V6 (USIM) output.
- A boost resistor was directly measured for a board_id 0x3a.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 52 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 52 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index d844b9c..490d79f 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -52,6 +52,8 @@
#include <linux/platform_data/camera-pxa.h>
#include <media/soc_camera.h>
+#include <linux/regulator/max1586.h>
+
#include "devices.h"
#include "generic.h"
@@ -787,6 +789,52 @@ static struct platform_device vads7846_device = {
};
/*
+ * Vcore regulator MAX1587A
+ */
+
+static struct regulator_consumer_supply magician_max1587a_consumers[] = {
+ REGULATOR_SUPPLY("vcc_core", NULL),
+};
+
+static struct regulator_init_data magician_max1587a_v3_info = {
+ .constraints = {
+ .name = "vcc_core range",
+ .min_uV = 700000,
+ .max_uV = 1500000,
+ .always_on = 1,
+ .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
+ },
+ .consumer_supplies = magician_max1587a_consumers,
+ .num_consumer_supplies = ARRAY_SIZE(magician_max1587a_consumers),
+};
+
+static struct max1586_subdev_data magician_max1587a_subdevs[] = {
+ {
+ .name = "vcc_core",
+ .id = MAX1586_V3,
+ .platform_data = &magician_max1587a_v3_info,
+ }
+};
+
+static struct max1586_platform_data magician_max1587a_info = {
+ .subdevs = magician_max1587a_subdevs,
+ .num_subdevs = ARRAY_SIZE(magician_max1587a_subdevs),
+ /*
+ * NOTICE measured directly on the PCB (board_id == 0x3a), but
+ * if R24 is present, it will boost the voltage
+ * (write 1.475V, get 1.645V and smoke)
+ */
+ .v3_gain = MAX1586_GAIN_NO_R24,
+};
+
+static struct i2c_board_info magician_pwr_i2c_board_info[] __initdata = {
+ {
+ I2C_BOARD_INFO("max1586", 0x14),
+ .platform_data = &magician_max1587a_info,
+ },
+};
+
+/*
* MMC/SD
*/
@@ -1066,6 +1114,10 @@ static void __init magician_init(void)
pxa_set_ficp_info(&magician_ficp_info);
pxa27x_set_i2c_power_info(&magician_i2c_power_info);
pxa_set_i2c_info(&i2c_info);
+
+ i2c_register_board_info(1,
+ ARRAY_AND_SIZE(magician_pwr_i2c_board_info));
+
pxa_set_mci_info(&magician_mci_info);
pxa_set_ohci_info(&magician_ohci_info);
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 21/26] ARM: pxa: magician: Add support for PXA27x UDC
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (4 preceding siblings ...)
2015-09-18 1:19 ` [PATCH v3 20/26] ARM: pxa: magician: Add support for MAX1587A Vcore regulator Petr Cvek
@ 2015-09-18 1:19 ` Petr Cvek
2015-09-18 1:20 ` [PATCH v3 22/26] ARM: pxa: magician: Remove pdata for pasic3-leds Petr Cvek
` (4 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:19 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
A PXA27x SoC supports USB device mode, this patch adds support for that.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 490d79f..76f8399 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -54,6 +54,10 @@
#include <linux/regulator/max1586.h>
+#include <linux/platform_data/pxa2xx_udc.h>
+#include <mach/udc.h>
+#include <mach/pxa27x-udc.h>
+
#include "devices.h"
#include "generic.h"
@@ -582,6 +586,23 @@ static struct platform_device pasic3 = {
* PXA UDC
*/
+static void magician_udc_command(int cmd)
+{
+ if (cmd == PXA2XX_UDC_CMD_CONNECT)
+ UP2OCR |= UP2OCR_DPPUE | UP2OCR_DPPUBE;
+ else if (cmd == PXA2XX_UDC_CMD_DISCONNECT)
+ UP2OCR &= ~(UP2OCR_DPPUE | UP2OCR_DPPUBE);
+}
+
+static struct pxa2xx_udc_mach_info magician_udc_info __initdata = {
+ .udc_command = magician_udc_command,
+ .gpio_pullup = GPIO27_MAGICIAN_USBC_PUEN,
+};
+
+/*
+ * USB device VUSB detection
+ */
+
static struct resource gpio_vbus_resource = {
.flags = IORESOURCE_IRQ,
.start = IRQ_MAGICIAN_VBUS,
@@ -1120,6 +1141,7 @@ static void __init magician_init(void)
pxa_set_mci_info(&magician_mci_info);
pxa_set_ohci_info(&magician_ohci_info);
+ pxa_set_udc_info(&magician_udc_info);
/* Check LCD type we have */
cpld = ioremap_nocache(PXA_CS3_PHYS, 0x1000);
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 22/26] ARM: pxa: magician: Remove pdata for pasic3-leds
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (5 preceding siblings ...)
2015-09-18 1:19 ` [PATCH v3 21/26] ARM: pxa: magician: Add support for PXA27x UDC Petr Cvek
@ 2015-09-18 1:20 ` Petr Cvek
2015-09-18 1:20 ` [PATCH v3 23/26] ARM: pxa: magician: Remove definition of the STUART port Petr Cvek
` (3 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:20 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
The pasic3-leds driver was never in vanilla kernel. Actual configuration
data for a hypothetical driver does not describe hardware completely, so
remove them.
This patch prepare HTC Magician machine code to pasic3-leds driver
addition.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 44 ++------------------------------------------
1 file changed, 2 insertions(+), 42 deletions(-)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 76f8399..a588fbc 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -510,46 +510,6 @@ static struct platform_device leds_gpio = {
};
/*
- * PASIC3 LEDs
- */
-
-static struct pasic3_led pasic3_leds[] = {
- {
- .led = {
- .name = "magician:red",
- .default_trigger = "ds2760-battery.0-charging",
- },
- .hw_num = 0,
- .bit2 = PASIC3_BIT2_LED0,
- .mask = PASIC3_MASK_LED0,
- },
- {
- .led = {
- .name = "magician:green",
- .default_trigger = "ds2760-battery.0-charging-or-full",
- },
- .hw_num = 1,
- .bit2 = PASIC3_BIT2_LED1,
- .mask = PASIC3_MASK_LED1,
- },
- {
- .led = {
- .name = "magician:blue",
- .default_trigger = "bluetooth",
- },
- .hw_num = 2,
- .bit2 = PASIC3_BIT2_LED2,
- .mask = PASIC3_MASK_LED2,
- },
-};
-
-static struct pasic3_leds_machinfo pasic3_leds_info = {
- .num_leds = ARRAY_SIZE(pasic3_leds),
- .power_gpio = EGPIO_MAGICIAN_LED_POWER,
- .leds = pasic3_leds,
-};
-
-/*
* PASIC3 DS1WM
*/
@@ -568,8 +528,8 @@ static struct resource pasic3_resources[] = {
};
static struct pasic3_platform_data pasic3_platform_data = {
- .led_pdata = &pasic3_leds_info,
- .clock_rate = 4000000,
+/* .led_pdata = &pasic3_leds_info,*/
+ .clock_rate = 4000000,
};
static struct platform_device pasic3 = {
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 23/26] ARM: pxa: magician: Remove definition of the STUART port
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (6 preceding siblings ...)
2015-09-18 1:20 ` [PATCH v3 22/26] ARM: pxa: magician: Remove pdata for pasic3-leds Petr Cvek
@ 2015-09-18 1:20 ` Petr Cvek
2015-09-18 1:20 ` [PATCH v3 24/26] ARM: pxa: magician: Add debug message for backlight brightness function Petr Cvek
` (2 subsequent siblings)
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:20 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
Magician STUART port is connected to the infraport and used by the FICP
driver. The FICP driver uses its own definition.
Required for correct initialization of the pxaficp_ir driver after
planned dmaengine conversion.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index a588fbc..386e6f0 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -1088,7 +1088,6 @@ static void __init magician_init(void)
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
- pxa_set_stuart_info(NULL);
platform_add_devices(ARRAY_AND_SIZE(devices));
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 24/26] ARM: pxa: magician: Add debug message for backlight brightness function
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (7 preceding siblings ...)
2015-09-18 1:20 ` [PATCH v3 23/26] ARM: pxa: magician: Remove definition of the STUART port Petr Cvek
@ 2015-09-18 1:20 ` Petr Cvek
2015-09-18 1:21 ` [PATCH v3 25/26] ARM: pxa: magician: Add missing regulator for PWM backlight Petr Cvek
2015-09-18 1:21 ` [PATCH v3 26/26] ARM: pxa: magician: Move platform_add_devices() to the end of magician_init() Petr Cvek
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:20 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
Add a debug message for the backlight brightness function.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 386e6f0..67969b1 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -437,6 +437,7 @@ static int magician_backlight_init(struct device *dev)
static int magician_backlight_notify(struct device *dev, int brightness)
{
+ pr_debug("Brightness = %i\n", brightness);
gpio_set_value(EGPIO_MAGICIAN_BL_POWER, brightness);
if (brightness >= 200) {
gpio_set_value(EGPIO_MAGICIAN_BL_POWER2, 1);
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 25/26] ARM: pxa: magician: Add missing regulator for PWM backlight
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (8 preceding siblings ...)
2015-09-18 1:20 ` [PATCH v3 24/26] ARM: pxa: magician: Add debug message for backlight brightness function Petr Cvek
@ 2015-09-18 1:21 ` Petr Cvek
2015-09-18 1:21 ` [PATCH v3 26/26] ARM: pxa: magician: Move platform_add_devices() to the end of magician_init() Petr Cvek
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:21 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
Add a fake regulator, which is required for the correct initialization
of the PWM backlight driver.
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index 67969b1..c43e587 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -425,6 +425,15 @@ static struct pxafb_mach_info samsung_info = {
* Backlight
*/
+ /*
+ * fixed regulator for pwm_backlight
+ */
+
+static struct regulator_consumer_supply pwm_backlight_supply[] = {
+ REGULATOR_SUPPLY("power", "pwm_backlight"),
+};
+
+
static struct gpio magician_bl_gpios[] = {
{ EGPIO_MAGICIAN_BL_POWER, GPIOF_DIR_OUT, "Backlight power" },
{ EGPIO_MAGICIAN_BL_POWER2, GPIOF_DIR_OUT, "Backlight power 2" },
@@ -1125,6 +1134,9 @@ static void __init magician_init(void)
spi_register_board_info(ARRAY_AND_SIZE(ads7846_spi_board_info));
pxa_set_camera_info(&magician_pxacamera_pdata);
+
+ regulator_register_always_on(0, "power", pwm_backlight_supply,
+ ARRAY_SIZE(pwm_backlight_supply), 5000000);
}
MACHINE_START(MAGICIAN, "HTC Magician")
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* [PATCH v3 26/26] ARM: pxa: magician: Move platform_add_devices() to the end of magician_init()
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
` (9 preceding siblings ...)
2015-09-18 1:21 ` [PATCH v3 25/26] ARM: pxa: magician: Add missing regulator for PWM backlight Petr Cvek
@ 2015-09-18 1:21 ` Petr Cvek
10 siblings, 0 replies; 11+ messages in thread
From: Petr Cvek @ 2015-09-18 1:21 UTC (permalink / raw)
To: robert.jarzmik, philipp.zabel, daniel, haojian.zhuang, linux
Cc: linux-kernel, linux-arm-kernel
This patch moves platform_add_devices() (standard declaration of devices)
outside of the platform specific device declarations. Moving to the end
of the magician_init() clarifies the source code (standard and specific
declaration are not mixed).
Signed-off-by: Petr Cvek <petr.cvek@tul.cz>
---
arch/arm/mach-pxa/magician.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-pxa/magician.c b/arch/arm/mach-pxa/magician.c
index c43e587..4ac1d55 100644
--- a/arch/arm/mach-pxa/magician.c
+++ b/arch/arm/mach-pxa/magician.c
@@ -1099,8 +1099,6 @@ static void __init magician_init(void)
pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL);
- platform_add_devices(ARRAY_AND_SIZE(devices));
-
pxa_set_ficp_info(&magician_ficp_info);
pxa27x_set_i2c_power_info(&magician_i2c_power_info);
pxa_set_i2c_info(&i2c_info);
@@ -1137,6 +1135,8 @@ static void __init magician_init(void)
regulator_register_always_on(0, "power", pwm_backlight_supply,
ARRAY_SIZE(pwm_backlight_supply), 5000000);
+
+ platform_add_devices(ARRAY_AND_SIZE(devices));
}
MACHINE_START(MAGICIAN, "HTC Magician")
--
1.7.12.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2015-09-18 1:21 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <cover.1442462898.git.petr.cvek@tul.cz>
2015-09-18 1:16 ` [PATCH v3 16/26] ARM: pxa: magician: Fix support for Intel Strata NOR Flash Petr Cvek
2015-09-18 1:17 ` [PATCH v3 17/26] ARM: pxa: magician: Fix wrongly enabled USB host ports Petr Cvek
2015-09-18 1:18 ` [PATCH v3 18/26] ARM: pxa: magician: Add support for ADS7846 Petr Cvek
2015-09-18 1:18 ` [PATCH v3 19/26] ARM: pxa: magician: Add support for Omnivision OV9640 camera Petr Cvek
2015-09-18 1:19 ` [PATCH v3 20/26] ARM: pxa: magician: Add support for MAX1587A Vcore regulator Petr Cvek
2015-09-18 1:19 ` [PATCH v3 21/26] ARM: pxa: magician: Add support for PXA27x UDC Petr Cvek
2015-09-18 1:20 ` [PATCH v3 22/26] ARM: pxa: magician: Remove pdata for pasic3-leds Petr Cvek
2015-09-18 1:20 ` [PATCH v3 23/26] ARM: pxa: magician: Remove definition of the STUART port Petr Cvek
2015-09-18 1:20 ` [PATCH v3 24/26] ARM: pxa: magician: Add debug message for backlight brightness function Petr Cvek
2015-09-18 1:21 ` [PATCH v3 25/26] ARM: pxa: magician: Add missing regulator for PWM backlight Petr Cvek
2015-09-18 1:21 ` [PATCH v3 26/26] ARM: pxa: magician: Move platform_add_devices() to the end of magician_init() Petr Cvek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox