* [PATCH 03/10] Input: bu21013_ts - Request a regulator that actually exists
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
Currently the BU21013 Touch Screen driver requests a regulator by the
name of 'V-TOUCH', which doesn't exist anywhere in the kernel. The
correct name, as referenced in platform regulator code is 'avdd'. Here,
when we request a regulator, we use the correct name instead.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/input/touchscreen/bu21013_ts.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index 5c487d2..2fae682 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -461,7 +461,7 @@ static int __devinit bu21013_probe(struct i2c_client *client,
bu21013_data->chip = pdata;
bu21013_data->client = client;
- bu21013_data->regulator = regulator_get(&client->dev, "V-TOUCH");
+ bu21013_data->regulator = regulator_get(&client->dev, "avdd");
if (IS_ERR(bu21013_data->regulator)) {
dev_err(&client->dev, "regulator_get failed\n");
error = PTR_ERR(bu21013_data->regulator);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 04/10] Input: bu21013_ts - Move GPIO init and exit functions into the driver
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
These GPIO init and exit functions have no place in platform data.
Instead they should be part of the driver. This patch moves them to
their rightful place, which subsequently elevates platform data of
yet more cruft.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-ux500/board-mop500-stuib.c | 70 +--------------------------
drivers/input/touchscreen/bu21013_ts.c | 76 ++++++++++++++++++++++++++----
include/linux/input/bu21013.h | 8 +---
3 files changed, 70 insertions(+), 84 deletions(-)
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 564f57d..eb19a7e 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -77,9 +77,6 @@ static struct i2c_board_info __initdata mop500_i2c0_devices_stuib[] = {
* BU21013 ROHM touchscreen interface on the STUIBs
*/
-/* tracks number of bu21013 devices being enabled */
-static int bu21013_devices;
-
#define TOUCH_GPIO_PIN 84
#define TOUCH_XMAX 384
@@ -88,73 +85,8 @@ static int bu21013_devices;
#define PRCMU_CLOCK_OCR 0x1CC
#define TSC_EXT_CLOCK_9_6MHZ 0x840000
-/**
- * bu21013_gpio_board_init : configures the touch panel.
- * @reset_pin: reset pin number
- * This function can be used to configures
- * the voltage and reset the touch panel controller.
- */
-static int bu21013_gpio_board_init(int reset_pin)
-{
- int retval = 0;
-
- bu21013_devices++;
- if (bu21013_devices == 1) {
- retval = gpio_request(reset_pin, "touchp_reset");
- if (retval) {
- printk(KERN_ERR "Unable to request gpio reset_pin");
- return retval;
- }
- retval = gpio_direction_output(reset_pin, 1);
- if (retval < 0) {
- printk(KERN_ERR "%s: gpio direction failed\n",
- __func__);
- return retval;
- }
- }
-
- return retval;
-}
-
-/**
- * bu21013_gpio_board_exit : deconfigures the touch panel controller
- * @reset_pin: reset pin number
- * This function can be used to deconfigures the chip selection
- * for touch panel controller.
- */
-static int bu21013_gpio_board_exit(int reset_pin)
-{
- int retval = 0;
-
- if (bu21013_devices == 1) {
- retval = gpio_direction_output(reset_pin, 0);
- if (retval < 0) {
- printk(KERN_ERR "%s: gpio direction failed\n",
- __func__);
- return retval;
- }
- gpio_set_value(reset_pin, 0);
- }
- bu21013_devices--;
-
- return retval;
-}
-
-/**
- * bu21013_read_pin_val : get the interrupt pin value
- * This function can be used to get the interrupt pin value for touch panel
- * controller.
- */
-static int bu21013_read_pin_val(void)
-{
- return gpio_get_value(TOUCH_GPIO_PIN);
-}
-
static struct bu21013_platform_device tsc_plat_device = {
- .cs_en = bu21013_gpio_board_init,
- .cs_dis = bu21013_gpio_board_exit,
- .irq_read_val = bu21013_read_pin_val,
- .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
+ .touch_pin = TOUCH_GPIO_PIN,
.touch_x_max = TOUCH_XMAX,
.touch_y_max = TOUCH_YMAX,
.ext_clk = false,
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index 2fae682..5d8fc75 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -14,6 +14,10 @@
#include <linux/slab.h>
#include <linux/regulator/consumer.h>
#include <linux/module.h>
+#include <linux/gpio.h>
+
+/* Reference tracking for multiple displays. */
+static int bu21013_devices = 0;
#define PEN_DOWN_INTR 0
#define MAX_FINGERS 2
@@ -262,7 +266,7 @@ static irqreturn_t bu21013_gpio_irq(int irq, void *device_data)
return IRQ_NONE;
}
- data->intr_pin = data->chip->irq_read_val();
+ data->intr_pin = gpio_get_value(data->chip->touch_pin);
if (data->intr_pin == PEN_DOWN_INTR)
wait_event_timeout(data->wait, data->touch_stopped,
msecs_to_jiffies(2));
@@ -272,6 +276,60 @@ static irqreturn_t bu21013_gpio_irq(int irq, void *device_data)
}
/**
+ * bu21013_gpio_board_init() - configures the touch panel
+ * @reset_pin: reset pin number
+ *
+ * This function is used to configure the voltage and
+ * reset the touch panel controller.
+ */
+static int bu21013_gpio_board_init(int reset_pin)
+{
+ int retval = 0;
+
+ bu21013_devices++;
+ if (bu21013_devices == 1) {
+ retval = gpio_request(reset_pin, "touchp_reset");
+ if (retval) {
+ printk(KERN_ERR "Unable to request gpio reset_pin");
+ return retval;
+ }
+ retval = gpio_direction_output(reset_pin, 1);
+ if (retval < 0) {
+ printk(KERN_ERR "%s: gpio direction failed\n",
+ __func__);
+ return retval;
+ }
+ }
+
+ return retval;
+}
+
+/**
+ * bu21013_gpio_board_exit() - deconfigures the touch panel controller
+ * @reset_pin: reset pin number
+ *
+ * This function is used to deconfigure the chip selection
+ * for touch panel controller.
+ */
+static int bu21013_gpio_board_exit(int reset_pin)
+{
+ int retval = 0;
+
+ if (bu21013_devices == 1) {
+ retval = gpio_direction_output(reset_pin, 0);
+ if (retval < 0) {
+ printk(KERN_ERR "%s: gpio direction failed\n",
+ __func__);
+ return retval;
+ }
+ gpio_set_value(reset_pin, 0);
+ }
+ bu21013_devices--;
+
+ return retval;
+}
+
+/**
* bu21013_init_chip() - power on sequence for the bu21013 controller
* @data: device structure pointer
*
@@ -449,6 +507,8 @@ static int __devinit bu21013_probe(struct i2c_client *client,
return -EINVAL;
}
+ pdata->irq = gpio_to_irq(pdata->touch_pin);
+
bu21013_data = kzalloc(sizeof(struct bu21013_ts_data), GFP_KERNEL);
in_dev = input_allocate_device();
if (!bu21013_data || !in_dev) {
@@ -478,12 +538,10 @@ static int __devinit bu21013_probe(struct i2c_client *client,
init_waitqueue_head(&bu21013_data->wait);
/* configure the gpio pins */
- if (pdata->cs_en) {
- error = pdata->cs_en(pdata->cs_pin);
- if (error < 0) {
- dev_err(&client->dev, "chip init failed\n");
- goto err_disable_regulator;
- }
+ error = bu21013_gpio_board_init(pdata->cs_pin);
+ if (error < 0) {
+ dev_err(&client->dev, "chip init failed\n");
+ goto err_disable_regulator;
}
/* configure the touch panel controller */
@@ -531,7 +589,7 @@ static int __devinit bu21013_probe(struct i2c_client *client,
err_free_irq:
bu21013_free_irq(bu21013_data);
err_cs_disable:
- pdata->cs_dis(pdata->cs_pin);
+ bu21013_gpio_board_exit(pdata->cs_pin);
err_disable_regulator:
regulator_disable(bu21013_data->regulator);
err_put_regulator:
@@ -555,7 +613,7 @@ static int __devexit bu21013_remove(struct i2c_client *client)
bu21013_free_irq(bu21013_data);
- bu21013_data->chip->cs_dis(bu21013_data->chip->cs_pin);
+ bu21013_gpio_board_exit(bu21013_data->chip->cs_pin);
input_unregister_device(bu21013_data->in_dev);
diff --git a/include/linux/input/bu21013.h b/include/linux/input/bu21013.h
index 05e0328..01a2975 100644
--- a/include/linux/input/bu21013.h
+++ b/include/linux/input/bu21013.h
@@ -9,13 +9,11 @@
/**
* struct bu21013_platform_device - Handle the platform data
- * @cs_en: pointer to the cs enable function
- * @cs_dis: pointer to the cs disable function
- * @irq_read_val: pointer to read the pen irq value function
* @touch_x_max: touch x max
* @touch_y_max: touch y max
* @cs_pin: chip select pin
* @irq: irq pin
+ * @touch_pin: touch gpio pin
* @ext_clk: external clock flag
* @x_flip: x flip flag
* @y_flip: y flip flag
@@ -24,13 +22,11 @@
* This is used to handle the platform data
*/
struct bu21013_platform_device {
- int (*cs_en)(int reset_pin);
- int (*cs_dis)(int reset_pin);
- int (*irq_read_val)(void);
int touch_x_max;
int touch_y_max;
unsigned int cs_pin;
unsigned int irq;
+ unsigned int touch_pin;
bool ext_clk;
bool x_flip;
bool y_flip;
--
1.7.9.5
^ permalink raw reply related
* [PATCH 05/10] Input: bu21013_ts - Add support for Device Tree booting
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
Now we can register the BU21013_ts touch screen when booting with
Device Tree enabled. Here we parse all the necessary components
previously expected to be passed from platform data.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
drivers/input/touchscreen/bu21013_ts.c | 39 ++++++++++++++++++++++++++++----
1 file changed, 35 insertions(+), 4 deletions(-)
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index 5d8fc75..3d1bff2 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -15,6 +15,8 @@
#include <linux/regulator/consumer.h>
#include <linux/module.h>
#include <linux/gpio.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
/* Reference tracking for multiple displays. */
static int bu21013_devices = 0;
@@ -487,13 +489,33 @@ static void bu21013_free_irq(struct bu21013_ts_data *bu21013_data)
* This function used to initializes the i2c-client touchscreen
* driver and returns integer.
*/
+static void __devinit bu21013_of_probe(struct device_node *np,
+ struct bu21013_platform_device *pdata)
+{
+ pdata->y_flip = pdata->x_flip = false;
+
+ if (of_get_property(np, "stricsson,flip-x", NULL))
+ pdata->x_flip = true;
+
+ if (of_get_property(np, "stricsson,flip-y", NULL))
+ pdata->y_flip = true;
+
+ of_property_read_u32(np, "stericsson,touch-max-x", &pdata->touch_x_max);
+ of_property_read_u32(np, "stericsson,touch-max-y", &pdata->touch_y_max);
+
+ pdata->touch_pin = of_get_named_gpio(np, "touch-gpio", 0);
+ pdata->cs_pin = of_get_named_gpio(np, "reset-gpio", 0);
+
+ pdata->ext_clk = false;
+}
+
static int __devinit bu21013_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct bu21013_ts_data *bu21013_data;
struct input_dev *in_dev;
- const struct bu21013_platform_device *pdata =
- client->dev.platform_data;
+ struct device_node *np = client->dev.of_node;
+ struct bu21013_platform_device *pdata = client->dev.platform_data;
int error;
if (!i2c_check_functionality(client->adapter,
@@ -503,8 +525,17 @@ static int __devinit bu21013_probe(struct i2c_client *client,
}
if (!pdata) {
- dev_err(&client->dev, "platform data not defined\n");
- return -EINVAL;
+ if (np) {
+ pdata = devm_kzalloc(&client->dev, sizeof(*pdata),
+ GFP_KERNEL);
+ if (!pdata)
+ return -ENOMEM;
+
+ bu21013_of_probe(np, pdata);
+ } else {
+ dev_err(&client->dev, "no device tree or platform data\n");
+ return -EINVAL;
+ }
}
pdata->irq = gpio_to_irq(pdata->touch_pin);
--
1.7.9.5
^ permalink raw reply related
* [PATCH 06/10] Documentation: Detail permitted DT properties for the BU21013 Touch Screen
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
Here we apply required documentation for the Rohm BU21013 Touch
Screen driver which describe available properties and how to use
them.
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: linux-input at vger.kernel.org
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
.../bindings/input/touchscreen/bu21013.txt | 28 ++++++++++++++++++++
1 file changed, 28 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/bu21013.txt
diff --git a/Documentation/devicetree/bindings/input/touchscreen/bu21013.txt b/Documentation/devicetree/bindings/input/touchscreen/bu21013.txt
new file mode 100644
index 0000000..51edc75
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/bu21013.txt
@@ -0,0 +1,28 @@
+* Rohm BU21013 Touch Screen
+
+Required properties:
+ - compatible : "stericsson,bu21013_tp"
+ - reg : I2C device address
+
+Optional properties:
+touch-gpio : GPIO pin registering a touch event
+<supply_name>-supply : Phandle to a regulator supply
+stericsson,touch-max-x : Maximum outward permitted limit in the X axis
+stericsson,touch-max-y : Maximum outward permitted limit in the Y axis
+stericsson,flip-x : Flip touch coordinates on the X axis
+stericsson,flip-y : Flip touch coordinates on the Y axis
+
+Example:
+
+ i2c at 80110000 {
+ bu21013_tp at 0x5c {
+ compatible = "bu21013_tp";
+ reg = <0x5c>;
+ touch-gpio = <&gpio2 20 0x4>;
+ avdd-supply = <&ab8500_ldo_aux1_reg>;
+
+ stericsson,touch-max-x = <384>;
+ stericsson,touch-max-y = <704>;
+ stricsson,flip-y;
+ };
+ };
--
1.7.9.5
^ permalink raw reply related
* [PATCH 07/10] ARM: ux500: Create a new Device Tree include file for boards supporting STUIBs
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
This is a skeleton creation which will be populated with the devices
found on one of ST-Ericsson's (UIB) User Interface Board.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/hrefprev60.dts | 1 +
arch/arm/boot/dts/hrefv60plus.dts | 1 +
arch/arm/boot/dts/stuib.dtsi | 15 +++++++++++++++
3 files changed, 17 insertions(+)
create mode 100644 arch/arm/boot/dts/stuib.dtsi
diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index 0756f97..e112cce 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -12,6 +12,7 @@
/dts-v1/;
/include/ "dbx5x0.dtsi"
/include/ "href.dtsi"
+/include/ "stuib.dtsi"
/ {
model = "ST-Ericsson HREF (pre-v60) platform with Device Tree";
diff --git a/arch/arm/boot/dts/hrefv60plus.dts b/arch/arm/boot/dts/hrefv60plus.dts
index 4b867b2..b5fc355 100644
--- a/arch/arm/boot/dts/hrefv60plus.dts
+++ b/arch/arm/boot/dts/hrefv60plus.dts
@@ -12,6 +12,7 @@
/dts-v1/;
/include/ "dbx5x0.dtsi"
/include/ "href.dtsi"
+/include/ "stuib.dtsi"
/ {
model = "ST-Ericsson HREF (v60+) platform with Device Tree";
diff --git a/arch/arm/boot/dts/stuib.dtsi b/arch/arm/boot/dts/stuib.dtsi
new file mode 100644
index 0000000..64ac327
--- /dev/null
+++ b/arch/arm/boot/dts/stuib.dtsi
@@ -0,0 +1,15 @@
+/*
+ * Copyright 2012 ST-Ericsson AB
+ *
+ * The code contained herein is licensed under the GNU General Public
+ * License. You may obtain a copy of the GNU General Public License
+ * Version 2 or later at the following locations:
+ *
+ * http://www.opensource.org/licenses/gpl-license.html
+ * http://www.gnu.org/copyleft/gpl.html
+ */
+
+/ {
+ soc-u9500 {
+ };
+};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 08/10] ARM: ux500: Stop calling the UIB init function when using Device Tree
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
As there will be a Device Tree created for the UIBs, there is no
need to call the UIB initiation functions. Each device will be
detailed and registered from the Device Tree instead.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-ux500/cpu-db8500.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index 610ad7f..f85659b 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -345,7 +345,7 @@ DT_MACHINE_START(U8500_DT, "ST-Ericsson U8500 platform (Device Tree Support)")
.timer = &ux500_timer,
.handle_irq = gic_handle_irq,
.init_machine = u8500_init_machine,
- .init_late = ux500_init_late,
+ .init_late = NULL,
.dt_compat = u8500_dt_board_compat,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related
* [PATCH 09/10] ARM: ux500: Add all bu21013 touch screen components to supported Device Trees
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
It is possible to connect a BU21013 Touch Screen to all version
of the HREF which support the ST-UIB. This patch applies all the
necessary settings to the pre-v60 and v60+ HREF Device Trees.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/boot/dts/hrefprev60.dts | 6 ++++++
arch/arm/boot/dts/hrefv60plus.dts | 8 ++++++++
arch/arm/boot/dts/stuib.dtsi | 23 +++++++++++++++++++++++
3 files changed, 37 insertions(+)
diff --git a/arch/arm/boot/dts/hrefprev60.dts b/arch/arm/boot/dts/hrefprev60.dts
index e112cce..cd9e535 100644
--- a/arch/arm/boot/dts/hrefprev60.dts
+++ b/arch/arm/boot/dts/hrefprev60.dts
@@ -31,5 +31,11 @@
reg = <0x33>;
};
};
+
+ i2c at 80110000 {
+ bu21013_tp at 0x5c {
+ reset-gpio = <&tc3589x_gpio 13 0x4>;
+ };
+ };
};
};
diff --git a/arch/arm/boot/dts/hrefv60plus.dts b/arch/arm/boot/dts/hrefv60plus.dts
index b5fc355..82103a2 100644
--- a/arch/arm/boot/dts/hrefv60plus.dts
+++ b/arch/arm/boot/dts/hrefv60plus.dts
@@ -23,4 +23,12 @@
gpios = <&gpio6 25 0x4>;
};
};
+
+ soc-u9500 {
+ i2c at 80110000 {
+ bu21013_tp at 0x5c {
+ reset-gpio = <&gpio4 15 0x4>;
+ };
+ };
+ };
};
diff --git a/arch/arm/boot/dts/stuib.dtsi b/arch/arm/boot/dts/stuib.dtsi
index 64ac327..5547f38 100644
--- a/arch/arm/boot/dts/stuib.dtsi
+++ b/arch/arm/boot/dts/stuib.dtsi
@@ -11,5 +11,28 @@
/ {
soc-u9500 {
+ i2c at 80110000 {
+ bu21013_tp at 0x5c {
+ compatible = "bu21013_tp";
+ reg = <0x5c>;
+ touch-gpio = <&gpio2 20 0x4>;
+ avdd-supply = <&ab8500_ldo_aux1_reg>;
+
+ stericsson,touch-max-x = <384>;
+ stericsson,touch-max-y = <704>;
+ stricsson,flip-y;
+ };
+
+ bu21013_tp at 0x5d {
+ compatible = "bu21013_tp";
+ reg = <0x5d>;
+ touch-gpio = <&gpio2 20 0x4>;
+ avdd-supply = <&ab8500_ldo_aux1_reg>;
+
+ stericsson,touch-max-x = <384>;
+ stericsson,touch-max-y = <704>;
+ stricsson,flip-y;
+ };
+ };
};
};
--
1.7.9.5
^ permalink raw reply related
* [PATCH 10/10] ARM: ux500: Stop informing the regulator subsystem that we have full constraints
From: Lee Jones @ 2012-10-02 8:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-1-git-send-email-lee.jones@linaro.org>
The regulator_has_full_constraints() call is not required if we
are booting with Device Tree as it's assumed in this case.
Signed-off-by: Lee Jones <lee.jones@linaro.org>
---
arch/arm/mach-ux500/cpu-db8500.c | 3 ---
1 file changed, 3 deletions(-)
diff --git a/arch/arm/mach-ux500/cpu-db8500.c b/arch/arm/mach-ux500/cpu-db8500.c
index f85659b..9f87b4d 100644
--- a/arch/arm/mach-ux500/cpu-db8500.c
+++ b/arch/arm/mach-ux500/cpu-db8500.c
@@ -325,9 +325,6 @@ static void __init u8500_init_machine(void)
/* automatically probe child nodes of db8500 device */
of_platform_populate(NULL, u8500_local_bus_nodes, u8500_auxdata_lookup, parent);
-
- /* This board has full regulator constraints */
- regulator_has_full_constraints();
}
static const char * u8500_dt_board_compat[] = {
--
1.7.9.5
^ permalink raw reply related
* [GIT PULL] CMA and DMA-mapping updates for v3.7
From: Marek Szyprowski @ 2012-10-02 8:18 UTC (permalink / raw)
To: linux-arm-kernel
Hi Linus,
I would like to ask for pulling another set of CMA and DMA-mapping framework
updates for v3.7.
The following changes since commit a0d271cbfed1dd50278c6b06bead3d00ba0a88f9:
Linux 3.6 (2012-09-30 16:47:46 -0700)
are available in the git repository at:
git://git.linaro.org/people/mszyprowski/linux-dma-mapping.git for-v3.7
for you to fetch changes up to 461b6f0d3d7d4e556035463b531136b034b7433e:
Merge branch 'next-cleanup' into for-v3.7 (2012-10-02 09:24:24 +0200)
----------------------------------------------------------------
This time the pull request is rather small, because the further redesign
patches were not ready on time.
This pull request consists of the patches which extend ARM DMA-mapping
subsystem with support for CPU coherent (ACP) DMA busses. The first
client of the new version is HighBank SATA driver. The second part of
the pull request includes various cleanup for both CMA common code and
ARM DMA-mapping subsystem.
Thanks!
Best regards
Marek Szyprowski
Samsung Poland R&D Center
Patch summary:
Hiroshi Doyu (3):
ARM: dma-mapping: Small logical clean up
ARM: dma-mapping: Refrain noisy console message
ARM: dma-mapping: Remove unsed var at arm_coherent_iommu_unmap_page
Marek Szyprowski (1):
Merge branch 'next-cleanup' into for-v3.7
Michal Nazarewicz (1):
drivers: dma-contiguous: refactor dma_alloc_from_contiguous()
Rob Herring (4):
ARM: add coherent dma ops
ARM: add coherent iommu dma ops
ARM: kill off arch_is_coherent
ARM: highbank: add coherent DMA setup
.../devicetree/bindings/ata/ahci-platform.txt | 3 +
.../devicetree/bindings/dma/arm-pl330.txt | 3 +
.../devicetree/bindings/net/calxeda-xgmac.txt | 3 +
arch/arm/boot/dts/highbank.dts | 1 +
arch/arm/include/asm/barrier.h | 7 +-
arch/arm/include/asm/dma-mapping.h | 1 +
arch/arm/include/asm/memory.h | 8 -
arch/arm/mach-highbank/highbank.c | 52 ++++
arch/arm/mm/dma-mapping.c | 264 +++++++++++++++-----
arch/arm/mm/mmu.c | 17 +-
drivers/base/dma-contiguous.c | 18 +-
11 files changed, 283 insertions(+), 94 deletions(-)
^ permalink raw reply
* [PATCH 2/3] ASoC: Davinci: pcm: add support for sram-support-less platforms
From: Sekhar Nori @ 2012-10-02 8:37 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20120922153313.GN4495@opensource.wolfsonmicro.com>
Hi Mark,
On 9/22/2012 9:03 PM, Mark Brown wrote:
> On Fri, Aug 31, 2012 at 06:20:58PM +0530, Hebbar, Gururaja wrote:
>
>> +config SND_DAVINCI_HAVE_SRAM
>> + bool
>> + default y if ARCH_DAVINCI=y
>> + default n if ARCH_OMAP=y
>> +
>
> I've been sitting on this mostly since it seems like a step back from
> multi-platform kernels (which is where we're trying to get to) and I've
> been trying to decide what the best approach is. I'm thinking that we
> do want a generic API for allocating this stuff, it's a fairly generic
> feature (there's TCMs as well).
>
> Adding ifdefs like this does just doesn't seem good.
How about converting to use genalloc instead of the DaVinci private SRAM
API and passing the pool to be used via platform data?
Matt Porter just used this approach to make the uio PRUSS driver usable
on both DaVinci and AM335x. It suffered from the exact same problem.
https://patchwork.kernel.org/patch/1522481/
Thanks,
Sekhar
^ permalink raw reply
* [PATCH v3] media: davinci: vpif: display: separate out subdev from output
From: Sekhar Nori @ 2012-10-02 8:48 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1348571509-4131-1-git-send-email-prabhakar.lad@ti.com>
On 9/25/2012 4:41 PM, Prabhakar wrote:
> From: Lad, Prabhakar <prabhakar.lad@ti.com>
>
> vpif_display relied on a 1-1 mapping of output and subdev. This is not
> necessarily the case. Separate the two. So there is a list of subdevs
> and a list of outputs. Each output refers to a subdev and has routing
> information. An output does not have to have a subdev.
>
> The initial output for each channel is set to the fist output.
>
> Currently missing is support for associating multiple subdevs with
> an output.
>
> Signed-off-by: Lad, Prabhakar <prabhakar.lad@ti.com>
> Signed-off-by: Manjunath Hadli <manjunath.hadli@ti.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Sekhar Nori <nsekhar@ti.com>
For the DaVinci platform changes:
Acked-by: Sekhar Nori <nsekhar@ti.com>
Thanks,
Sekhar
^ permalink raw reply
* [PATCH 01/10] ARM: ux500: Move all Device Tree booting into cpu-db8500
From: Linus Walleij @ 2012-10-02 8:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-2-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> To aid the kernel in its effort to move to DT only booting, we're
> transplanting all Device Tree related code to cpu-db8500 which will
> remain persistent throughout the transition. This change paths the
> way for complete removal of board-mop500, which will be done once
> the all DMA settings are moved into the respective DT source files.
>
> Acked-by: Arnd Bergmann <arnd@arndb.de>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Looks good:
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 02/10] ARM: ux500: Strip out duplicate touch screen platform information
From: Linus Walleij @ 2012-10-02 9:07 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-3-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> We're currently carrying two 'struct bu21013_platform_device's which
> are identical for no apparent reason. Here we remove the extra burden
> and apply the same information to the two different instances of the
> bu21012_tp driver registration.
>
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Makes perfect sense.
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH] ARM: hw_breakpoint: Clear breakpoints before enabling monitor mode
From: Will Deacon @ 2012-10-02 9:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <506A3694.4070004@codeaurora.org>
On Tue, Oct 02, 2012 at 01:34:28AM +0100, Stephen Boyd wrote:
> On 09/24/12 10:19, Will Deacon wrote:
> > Ok, I've pushed a bunch of patches to my hw-breakpoint branch (head commit
> > 55cb726797c7). I'll post them to the list after the merge window, but please
> > do take them for a spin if you get a chance.
> >
>
> Forgot to reply here. Took them for a spin last week with that commit.
> No more boot hangs but I can't say much else beyond that. When you post
> to the list I'll add my tested-by.
Thanks Stephen. I've also got some patches for OS save/restore of the debug
registers using the various hardware locking and readout mechanisms, so that
debug state can be persisted across low-power states.
Do any of the Qualcomm chips (v7 as opposed to v7.1) implement the save/restore
registers?
Will
^ permalink raw reply
* [PATCH v2 0/6] ARM: EXYNOS: Add secure firmware support
From: Tomasz Figa @ 2012-10-02 9:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1348496913-25422-1-git-send-email-t.figa@samsung.com>
Hi,
On Monday 24 of September 2012 16:28:27 Tomasz Figa wrote:
> Some Exynos-based boards are running with secure firmware running in
> TrustZone secure world, which changes the way some things have to be
> initialized.
>
> This series adds support for specifying firmware operations, implements
> some firmware operations for Exynos secure firmware and adds a method of
> enabling secure firmware operations on Exynos-based boards through board
> file and device tree.
>
> Changes since v1
> http://thread.gmane.org/gmane.linux.kernel.samsung-soc/12583/focus=12820
> - Changed return types of all operations to int
> - Defined all operations to return 0 on success, -ENOSYS when not
> implemented or appropriate error code on error
>
> Tomasz Figa (6):
> ARM: Add interface for registering and calling firmware-specific
> operations
> ARM: EXYNOS: Add support for secure monitor calls
> ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412
> ARM: EXYNOS: Add IO mapping for non-secure SYSRAM.
> ARM: EXYNOS: Add support for Exynos secure firmware
> ARM: EXYNOS: Add secure firmware support to secondary CPU bring-up
>
> .../devicetree/bindings/arm/samsung-boards.txt | 8 ++++
> arch/arm/common/Makefile | 2 +
> arch/arm/common/firmware.c | 18 ++++++++
> arch/arm/include/asm/firmware.h | 31 +++++++++++++
> arch/arm/mach-exynos/Makefile | 6 +++
> arch/arm/mach-exynos/common.c | 34 ++++++++++++++
> arch/arm/mach-exynos/common.h | 2 +
> arch/arm/mach-exynos/exynos-smc.S | 22 +++++++++
> arch/arm/mach-exynos/firmware.c | 54
> ++++++++++++++++++++++ arch/arm/mach-exynos/include/mach/map.h
> | 3 ++
> arch/arm/mach-exynos/mach-exynos4-dt.c | 1 +
> arch/arm/mach-exynos/platsmp.c | 36 ++++++++++++---
> arch/arm/mach-exynos/smc.h | 31 +++++++++++++
> arch/arm/plat-samsung/include/plat/map-s5p.h | 1 +
> 14 files changed, 243 insertions(+), 6 deletions(-)
> create mode 100644 arch/arm/common/firmware.c
> create mode 100644 arch/arm/include/asm/firmware.h
> create mode 100644 arch/arm/mach-exynos/exynos-smc.S
> create mode 100644 arch/arm/mach-exynos/firmware.c
> create mode 100644 arch/arm/mach-exynos/smc.h
Any comments, nitpicks or acks on this patchset?
Best regards,
--
Tomasz Figa
Samsung Poland R&D Center
^ permalink raw reply
* [PATCH 03/10] Input: bu21013_ts - Request a regulator that actually exists
From: Linus Walleij @ 2012-10-02 9:16 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-4-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> Currently the BU21013 Touch Screen driver requests a regulator by the
> name of 'V-TOUCH', which doesn't exist anywhere in the kernel. The
> correct name, as referenced in platform regulator code is 'avdd'. Here,
> when we request a regulator, we use the correct name instead.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Mark Brown requested this (real) name of the regulator a while back.
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
This should go separately into the -rc fixes or directly upstream.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 04/10] Input: bu21013_ts - Move GPIO init and exit functions into the driver
From: Linus Walleij @ 2012-10-02 9:18 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-5-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> These GPIO init and exit functions have no place in platform data.
> Instead they should be part of the driver. This patch moves them to
> their rightful place, which subsequently elevates platform data of
> yet more cruft.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 05/10] Input: bu21013_ts - Add support for Device Tree booting
From: Linus Walleij @ 2012-10-02 9:20 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-6-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> Now we can register the BU21013_ts touch screen when booting with
> Device Tree enabled. Here we parse all the necessary components
> previously expected to be passed from platform data.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH 06/10] Documentation: Detail permitted DT properties for the BU21013 Touch Screen
From: Linus Walleij @ 2012-10-02 9:21 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349165603-24401-7-git-send-email-lee.jones@linaro.org>
On Tue, Oct 2, 2012 at 10:13 AM, Lee Jones <lee.jones@linaro.org> wrote:
> Here we apply required documentation for the Rohm BU21013 Touch
> Screen driver which describe available properties and how to use
> them.
>
> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> Cc: linux-input at vger.kernel.org
> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Should be CC to the devicetree-discuss list right?
FWIW:
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH v2 0/4] ARM: EXYNOS: Power domain DT support extension
From: Tomasz Figa @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
This patch series fixes two issues with existing DT support for Exynos
power domains and extends it with the ability of binding devices to domains,
basically making it possible to use power domains with DT.
Based on next/dt-samsung-new branch of Samsung tree.
Changes since v1:
- Added "samsung," prefix to "power-domain" property.
- Added power domain nodes to Exynos4 device tree sources.
Tomasz Figa (4):
ARM: EXYNOS: pm_domain: Detect domain state on registration from DT
ARM: EXYNOS: pm_domain: Fix power domain name initialization
ARM: EXYNOS: pm_domain: Bind devices to power domains using DT
ARM: dts: exynos4: Set up power domains
.../bindings/arm/exynos/power_domain.txt | 15 +++-
arch/arm/boot/dts/exynos4.dtsi | 30 +++++++
arch/arm/boot/dts/exynos4210.dtsi | 5 ++
arch/arm/mach-exynos/pm_domains.c | 93 +++++++++++++++++++++-
4 files changed, 135 insertions(+), 8 deletions(-)
--
1.7.12
^ permalink raw reply
* [PATCH v2 1/4] ARM: EXYNOS: pm_domain: Detect domain state on registration from DT
From: Tomasz Figa @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349169846-30385-1-git-send-email-t.figa@samsung.com>
Initial state of power domains might vary on different boards and with
different bootloaders. This patch adds detection of initial state of
power domains when being registered from DT.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
Documentation/devicetree/bindings/arm/exynos/power_domain.txt | 4 ----
arch/arm/mach-exynos/pm_domains.c | 8 +++++---
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 6528e21..843b546 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -9,10 +9,6 @@ Required Properties:
- reg: physical base address of the controller and length of memory mapped
region.
-Optional Properties:
-- samsung,exynos4210-pd-off: Specifies that the power domain is in turned-off
- state during boot and remains to be turned-off until explicitly turned-on.
-
Example:
lcd0: power-domain-lcd0 {
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index c0bc83a..d1abc1a 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -89,6 +89,7 @@ static __init int exynos_pm_dt_parse_domains(void)
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
struct exynos_pm_domain *pd;
+ int on;
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (!pd) {
@@ -97,14 +98,15 @@ static __init int exynos_pm_dt_parse_domains(void)
return -ENOMEM;
}
- if (of_get_property(np, "samsung,exynos4210-pd-off", NULL))
- pd->is_off = true;
pd->name = np->name;
pd->base = of_iomap(np, 0);
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
pd->pd.of_node = np;
- pm_genpd_init(&pd->pd, NULL, false);
+
+ on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
+
+ pm_genpd_init(&pd->pd, NULL, !on);
}
return 0;
}
--
1.7.12
^ permalink raw reply related
* [PATCH v2 2/4] ARM: EXYNOS: pm_domain: Fix power domain name initialization
From: Tomasz Figa @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349169846-30385-1-git-send-email-t.figa@samsung.com>
This patch adds initialization of name field in generic power domain
struct.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/mach-exynos/pm_domains.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index d1abc1a..5b7ce7e 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -98,7 +98,8 @@ static __init int exynos_pm_dt_parse_domains(void)
return -ENOMEM;
}
- pd->name = np->name;
+ pd->pd.name = kstrdup(np->name, GFP_KERNEL);
+ pd->name = pd->pd.name;
pd->base = of_iomap(np, 0);
pd->pd.power_off = exynos_pd_power_off;
pd->pd.power_on = exynos_pd_power_on;
--
1.7.12
^ permalink raw reply related
* [PATCH v2 3/4] ARM: EXYNOS: pm_domain: Bind devices to power domains using DT
From: Tomasz Figa @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349169846-30385-1-git-send-email-t.figa@samsung.com>
This patch adds a way to specify bindings between devices and power
domains using device tree.
A device can be bound to particular power domain by adding a
power-domain property containing a phandle to the domain. The device
will be bound to the domain before binding a driver to it and unbound
after unbinding a driver from it.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
.../bindings/arm/exynos/power_domain.txt | 13 +++-
arch/arm/mach-exynos/pm_domains.c | 82 ++++++++++++++++++++++
2 files changed, 94 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
index 843b546..5216b41 100644
--- a/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
+++ b/Documentation/devicetree/bindings/arm/exynos/power_domain.txt
@@ -4,14 +4,25 @@ Exynos processors include support for multiple power domains which are used
to gate power to one or more peripherals on the processor.
Required Properties:
-- compatiable: should be one of the following.
+- compatible: should be one of the following.
* samsung,exynos4210-pd - for exynos4210 type power domain.
- reg: physical base address of the controller and length of memory mapped
region.
+Node of a device using power domains must have a samsung,power-domain property
+defined with a phandle to respective power domain.
+
Example:
lcd0: power-domain-lcd0 {
compatible = "samsung,exynos4210-pd";
reg = <0x10023C00 0x10>;
};
+
+Example of the node using power domain:
+
+ node {
+ /* ... */
+ samsung,power-domain = <&lcd0>;
+ /* ... */
+ };
diff --git a/arch/arm/mach-exynos/pm_domains.c b/arch/arm/mach-exynos/pm_domains.c
index 5b7ce7e..4063016 100644
--- a/arch/arm/mach-exynos/pm_domains.c
+++ b/arch/arm/mach-exynos/pm_domains.c
@@ -19,6 +19,8 @@
#include <linux/pm_domain.h>
#include <linux/delay.h>
#include <linux/of_address.h>
+#include <linux/of_platform.h>
+#include <linux/sched.h>
#include <mach/regs-pmu.h>
#include <plat/devs.h>
@@ -83,14 +85,89 @@ static struct exynos_pm_domain PD = { \
}
#ifdef CONFIG_OF
+static void exynos_add_device_to_domain(struct exynos_pm_domain *pd,
+ struct device *dev)
+{
+ int ret;
+
+ dev_dbg(dev, "adding to power domain %s\n", pd->pd.name);
+
+ while(1) {
+ ret = pm_genpd_add_device(&pd->pd, dev);
+ if (ret != -EAGAIN)
+ break;
+ cond_resched();
+ }
+
+ pm_genpd_dev_need_restore(dev, true);
+}
+
+static void exynos_remove_device_from_domain(struct device *dev)
+{
+ struct generic_pm_domain *genpd = dev_to_genpd(dev);
+ int ret;
+
+ dev_dbg(dev, "removing from power domain %s\n", genpd->name);
+
+ while(1) {
+ ret = pm_genpd_remove_device(genpd, dev);
+ if (ret != -EAGAIN)
+ break;
+ cond_resched();
+ }
+}
+
+static void exynos_read_domain_from_dt(struct device *dev)
+{
+ struct platform_device *pd_pdev;
+ struct exynos_pm_domain *pd;
+ struct device_node *node;
+
+ node = of_parse_phandle(dev->of_node, "samsung,power-domain", 0);
+ if (!node)
+ return;
+ pd_pdev = of_find_device_by_node(node);
+ if (!pd_pdev)
+ return;
+ pd = platform_get_drvdata(pd_pdev);
+ exynos_add_device_to_domain(pd, dev);
+}
+
+static int exynos_pm_notifier_call(struct notifier_block *nb,
+ unsigned long event, void *data)
+{
+ struct device *dev = data;
+
+ switch (event) {
+ case BUS_NOTIFY_BIND_DRIVER:
+ if (dev->of_node)
+ exynos_read_domain_from_dt(dev);
+
+ break;
+
+ case BUS_NOTIFY_UNBOUND_DRIVER:
+ exynos_remove_device_from_domain(dev);
+
+ break;
+ }
+ return NOTIFY_DONE;
+}
+
+static struct notifier_block platform_nb = {
+ .notifier_call = exynos_pm_notifier_call,
+};
+
static __init int exynos_pm_dt_parse_domains(void)
{
+ struct platform_device *pdev;
struct device_node *np;
for_each_compatible_node(np, NULL, "samsung,exynos4210-pd") {
struct exynos_pm_domain *pd;
int on;
+ pdev = of_find_device_by_node(np);
+
pd = kzalloc(sizeof(*pd), GFP_KERNEL);
if (!pd) {
pr_err("%s: failed to allocate memory for domain\n",
@@ -105,10 +182,15 @@ static __init int exynos_pm_dt_parse_domains(void)
pd->pd.power_on = exynos_pd_power_on;
pd->pd.of_node = np;
+ platform_set_drvdata(pdev, pd);
+
on = __raw_readl(pd->base + 0x4) & S5P_INT_LOCAL_PWR_EN;
pm_genpd_init(&pd->pd, NULL, !on);
}
+
+ bus_register_notifier(&platform_bus_type, &platform_nb);
+
return 0;
}
#else
--
1.7.12
^ permalink raw reply related
* [PATCH v2 4/4] ARM: dts: exynos4: Set up power domains
From: Tomasz Figa @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1349169846-30385-1-git-send-email-t.figa@samsung.com>
This patch adds device tree nodes for power domains of Exynos4 SoCs.
Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
---
arch/arm/boot/dts/exynos4.dtsi | 30 ++++++++++++++++++++++++++++++
arch/arm/boot/dts/exynos4210.dtsi | 5 +++++
2 files changed, 35 insertions(+)
diff --git a/arch/arm/boot/dts/exynos4.dtsi b/arch/arm/boot/dts/exynos4.dtsi
index a26c3dd..0c14f50 100644
--- a/arch/arm/boot/dts/exynos4.dtsi
+++ b/arch/arm/boot/dts/exynos4.dtsi
@@ -30,6 +30,36 @@
spi2 = &spi_2;
};
+ pd_mfc: mfc-power-domain at 10023C40 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023C40 0x20>;
+ };
+
+ pd_g3d: g3d-power-domain at 10023C60 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023C60 0x20>;
+ };
+
+ pd_lcd0: lcd0-power-domain at 10023C80 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023C80 0x20>;
+ };
+
+ pd_tv: tv-power-domain at 10023C20 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023C20 0x20>;
+ };
+
+ pd_cam: cam-power-domain at 10023C00 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023C00 0x20>;
+ };
+
+ pd_gps: gps-power-domain at 10023CE0 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023CE0 0x20>;
+ };
+
gic:interrupt-controller at 10490000 {
compatible = "arm,cortex-a9-gic";
#interrupt-cells = <3>;
diff --git a/arch/arm/boot/dts/exynos4210.dtsi b/arch/arm/boot/dts/exynos4210.dtsi
index 214c557..f9f840e 100644
--- a/arch/arm/boot/dts/exynos4210.dtsi
+++ b/arch/arm/boot/dts/exynos4210.dtsi
@@ -31,6 +31,11 @@
pinctrl2 = &pinctrl_2;
};
+ pd_lcd1: lcd1-power-domain at 10023CA0 {
+ compatible = "samsung,exynos4210-pd";
+ reg = <0x10023CA0 0x20>;
+ };
+
gic:interrupt-controller at 10490000 {
cpu-offset = <0x8000>;
};
--
1.7.12
^ permalink raw reply related
* [PATCH v2 08/10] ARM: KVM: VGIC initialisation code
From: Will Deacon @ 2012-10-02 9:24 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20121001091426.49503.94722.stgit@ubuntu>
On Mon, Oct 01, 2012 at 10:14:26AM +0100, Christoffer Dall wrote:
> From: Marc Zyngier <marc.zyngier@arm.com>
>
> Add the init code for the hypervisor, the virtual machine, and
> the virtual CPUs.
>
> An interrupt handler is also wired to allow the VGIC maintenance
> interrupts, used to deal with level triggered interrupts and LR
> underflows.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com>
> Signed-off-by: Christoffer Dall <c.dall@virtualopensystems.com>
> ---
[...]
> diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c
> index b52d4c2..fc2a138 100644
> --- a/arch/arm/kvm/vgic.c
> +++ b/arch/arm/kvm/vgic.c
> @@ -20,7 +20,14 @@
> #include <linux/kvm_host.h>
> #include <linux/interrupt.h>
> #include <linux/io.h>
> +#include <linux/of.h>
> +#include <linux/of_address.h>
> +#include <linux/of_irq.h>
> +
> #include <asm/kvm_emulate.h>
> +#include <asm/hardware/gic.h>
> +#include <asm/kvm_arm.h>
> +#include <asm/kvm_mmu.h>
>
> /*
> * How the whole thing works (courtesy of Christoffer Dall):
> @@ -61,6 +68,13 @@
> /* Temporary hacks, need to be provided by userspace emulation */
> #define VGIC_DIST_BASE 0x2c001000
> #define VGIC_DIST_SIZE 0x1000
> +#define VGIC_CPU_BASE 0x2c002000
> +#define VGIC_CPU_SIZE 0x2000
We really don't want the physical memory map for the guest hardwired in the
kernel. Please find a way to parameterise this from userspace.
Will
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox