* [GIT PULL] Allwinner clocks changes for 4.9
From: Maxime Ripard @ 2016-09-11 20:21 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Here is the usual bunch of clock patches for the Allwinner SoCs, this
time converting more SoCs to the new framework.
Thanks!
Maxime
The following changes since commit 29b4817d4018df78086157ea3a55c1d9424a7cfc:
Linux 4.8-rc1 (2016-08-07 18:18:00 -0700)
are available in the git repository at:
https://git.kernel.org/pub/scm/linux/kernel/git/mripard/linux.git tags/sunxi-clk-for-4.9
for you to fetch changes up to d63a5e7c713a68bd368016f2022326a1a91310d8:
clk: sunxi-ng: Add hardware dependency (2016-09-10 11:41:21 +0200)
----------------------------------------------------------------
Allwinner Clock changes for 4.9
Four more SoCs converted to the new clock framework (A31, A31s, A23 and
A33).
----------------------------------------------------------------
Chen-Yu Tsai (6):
clk: sunxi-ng: mux: Increase fixed pre-divider div size
clk: sunxi-ng: nkm: Add mux to support multiple parents
clk: sunxi-ng: mux: Add support for mux tables
clk: sunxi-ng: mux: support fixed pre-dividers on multiple parents
clk: sunxi-ng: mux: Add clk notifier functions
clk: sunxi-ng: Add A31/A31s clocks
Jean Delvare (1):
clk: sunxi-ng: Add hardware dependency
Maxime Ripard (8):
clk: sunxi-ng: mux: Rename mux macro to be consistent
clk: sunxi-ng: div: Add mux table macros
clk: sunxi-ng: div: Add kerneldoc for the _ccu_div structure
clk: sunxi-ng: div: Allow to set a maximum
clk: sunxi-ng: mux: Add mux table macro
clk: sunxi-ng: Add N-class clocks support
clk: sunxi-ng: Add A33 CCU support
clk: sunxi-ng: Add A23 CCU
.../devicetree/bindings/clock/sunxi-ccu.txt | 5 +-
drivers/clk/sunxi-ng/Kconfig | 39 +
drivers/clk/sunxi-ng/Makefile | 4 +
drivers/clk/sunxi-ng/ccu-sun6i-a31.c | 1235 ++++++++++++++++++++
drivers/clk/sunxi-ng/ccu-sun6i-a31.h | 72 ++
drivers/clk/sunxi-ng/ccu-sun8i-a23-a33.h | 63 +
drivers/clk/sunxi-ng/ccu-sun8i-a23.c | 737 ++++++++++++
drivers/clk/sunxi-ng/ccu-sun8i-a33.c | 780 +++++++++++++
drivers/clk/sunxi-ng/ccu-sun8i-h3.c | 10 +-
drivers/clk/sunxi-ng/ccu_div.h | 66 +-
drivers/clk/sunxi-ng/ccu_mp.c | 23 +-
drivers/clk/sunxi-ng/ccu_mp.h | 2 +-
drivers/clk/sunxi-ng/ccu_mult.c | 133 +++
drivers/clk/sunxi-ng/ccu_mult.h | 35 +
drivers/clk/sunxi-ng/ccu_mux.c | 56 +-
drivers/clk/sunxi-ng/ccu_mux.h | 68 +-
drivers/clk/sunxi-ng/ccu_nkm.c | 44 +-
drivers/clk/sunxi-ng/ccu_nkm.h | 23 +
drivers/clk/sunxi-ng/ccu_nkmp.c | 21 +-
drivers/clk/sunxi-ng/ccu_nm.c | 16 +-
include/dt-bindings/clock/sun6i-a31-ccu.h | 187 +++
include/dt-bindings/clock/sun8i-a23-a33-ccu.h | 127 ++
include/dt-bindings/reset/sun6i-a31-ccu.h | 106 ++
include/dt-bindings/reset/sun8i-a23-a33-ccu.h | 87 ++
24 files changed, 3860 insertions(+), 79 deletions(-)
create mode 100644 drivers/clk/sunxi-ng/ccu-sun6i-a31.c
create mode 100644 drivers/clk/sunxi-ng/ccu-sun6i-a31.h
create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-a23-a33.h
create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-a23.c
create mode 100644 drivers/clk/sunxi-ng/ccu-sun8i-a33.c
create mode 100644 drivers/clk/sunxi-ng/ccu_mult.c
create mode 100644 include/dt-bindings/clock/sun6i-a31-ccu.h
create mode 100644 include/dt-bindings/clock/sun8i-a23-a33-ccu.h
create mode 100644 include/dt-bindings/reset/sun6i-a31-ccu.h
create mode 100644 include/dt-bindings/reset/sun8i-a23-a33-ccu.h
--
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20160911/71472c94/attachment.sig>
^ permalink raw reply
* [PATCH resend 5/5] input: touchscreen: Add support for Elan eKTF2127 touchscreen controller
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911184408.11657-1-hdegoede@redhat.com>
From: Siebren Vroegindeweij <siebren.vroegindeweij@hotmail.com>
This adds a driver for the Elan eKTF2127 touchscreen controller,
which speaks an i2c protocol which is distinctly different from
the already supported eKTH controllers.
Signed-off-by: Michel Verlaan <michel.verl@gmail.com>
Signed-off-by: Siebren Vroegindeweij <siebren.vroegindeweij@hotmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Rob Herring <robh@kernel.org>
---
Changes in v2:
-Improve devicetree bindings document
-Use touchscreen_parse_properties and touchscreen_report_pos instead of DIY
-Remove a bunch of unused defines (copy and paste leftover from chipone driver)
-Some other minor cleanups and review comments addressed
-Add defines for some command / address hex-values
-Check packet header in interrupt handler
---
.../bindings/input/touchscreen/ektf2127.txt | 27 ++
drivers/input/touchscreen/Kconfig | 12 +
drivers/input/touchscreen/Makefile | 1 +
drivers/input/touchscreen/ektf2127.c | 333 +++++++++++++++++++++
4 files changed, 373 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt
create mode 100644 drivers/input/touchscreen/ektf2127.c
diff --git a/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt b/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt
new file mode 100644
index 0000000..70a949b
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/ektf2127.txt
@@ -0,0 +1,27 @@
+* Elan eKTF2127 I2C touchscreen controller
+
+Required properties:
+ - compatible : "elan,ektf2127"
+ - reg : I2C slave address of the chip (0x40)
+ - interrupt-parent : a phandle pointing to the interrupt controller
+ serving the interrupt for this chip
+ - interrupts : interrupt specification for the ektf2127 interrupt
+ - power-gpios : GPIO specification for the pin connected to the
+ ektf2127's wake input. This needs to be driven high
+ to take ektf2127 out of it's low power state
+
+For additional optional properties see: touchscreen.txt
+
+Example:
+
+i2c at 00000000 {
+ ektf2127: touchscreen at 15 {
+ compatible = "elan,ektf2127";
+ reg = <0x15>;
+ interrupt-parent = <&pio>;
+ interrupts = <6 11 IRQ_TYPE_EDGE_FALLING>;
+ power-gpios = <&pio 1 3 GPIO_ACTIVE_HIGH>;
+ touchscreen-inverted-x;
+ touchscreen-swapped-x-y;
+ };
+};
diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig
index 3b3d07a..880aa50 100644
--- a/drivers/input/touchscreen/Kconfig
+++ b/drivers/input/touchscreen/Kconfig
@@ -396,6 +396,18 @@ config TOUCHSCREEN_ELAN
To compile this driver as a module, choose M here: the
module will be called elants_i2c.
+config TOUCHSCREEN_EKTF2127
+ tristate "Elan eKTF2127 I2C touchscreen"
+ depends on I2C
+ help
+ Say Y here if you have an Elan eKTF2127 touchscreen
+ connected to your system.
+
+ If unsure, say N.
+
+ To compile this driver as a module, choose M here: the
+ module will be called ektf2127.
+
config TOUCHSCREEN_ELO
tristate "Elo serial touchscreens"
select SERIO
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 33b2eb8..db876ef 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -33,6 +33,7 @@ obj-$(CONFIG_TOUCHSCREEN_HAMPSHIRE) += hampshire.o
obj-$(CONFIG_TOUCHSCREEN_GUNZE) += gunze.o
obj-$(CONFIG_TOUCHSCREEN_EETI) += eeti_ts.o
obj-$(CONFIG_TOUCHSCREEN_ELAN) += elants_i2c.o
+obj-$(CONFIG_TOUCHSCREEN_EKTF2127) += ektf2127.o
obj-$(CONFIG_TOUCHSCREEN_ELO) += elo.o
obj-$(CONFIG_TOUCHSCREEN_EGALAX) += egalax_ts.o
obj-$(CONFIG_TOUCHSCREEN_EGALAX_SERIAL) += egalax_ts_serial.o
diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
new file mode 100644
index 0000000..512a394
--- /dev/null
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -0,0 +1,333 @@
+/*
+ * Driver for ELAN eKTF2127 i2c touchscreen controller
+ *
+ * For this driver the layout of the Chipone icn8318 i2c
+ * touchscreencontroller is used.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * Author:
+ * Michel Verlaan <michel.verl@gmail.com>
+ * Siebren Vroegindeweij <siebren.vroegindeweij@hotmail.com>
+ *
+ * Original chipone_icn8318 driver:
+ * Hans de Goede <hdegoede@redhat.com>
+ */
+
+#include <linux/gpio/consumer.h>
+#include <linux/interrupt.h>
+#include <linux/i2c.h>
+#include <linux/input.h>
+#include <linux/input/mt.h>
+#include <linux/input/touchscreen.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/delay.h>
+
+/* Packet header defines (first byte of data send / received) */
+#define EKTF2127_NOISE 0x40
+#define EKTF2127_RESPONSE 0x52
+#define EKTF2127_REQUEST 0x53
+#define EKTF2127_HELLO 0x55
+#define EKTF2127_REPORT 0x5d
+#define EKTF2127_CALIB_DONE 0x66
+
+/* Register deines (second byte of data send / received) */
+#define EKTF2127_ENV_NOISY 0x41
+#define EKTF2127_HEIGHT 0x60
+#define EKTF2127_WIDTH 0x63
+
+/* 2 bytes header + 5 * 3 bytes coordinates + 3 bytes pressure info + footer */
+#define EKTF2127_TOUCH_REPORT_SIZE 21
+#define EKTF2127_MAX_TOUCHES 5
+
+struct ektf2127_data {
+ struct i2c_client *client;
+ struct input_dev *input;
+ struct gpio_desc *power_gpios;
+ struct touchscreen_properties prop;
+};
+
+static void retrieve_coordinates(struct input_mt_pos *touches,
+ int touch_count, char *buf)
+{
+ int index = 0;
+ int i = 0;
+
+ for (i = 0; i < touch_count; i++) {
+ index = 2 + i * 3;
+
+ touches[i].x = (buf[index] & 0x0f);
+ touches[i].x <<= 8;
+ touches[i].x |= buf[index + 2];
+
+ touches[i].y = (buf[index] & 0xf0);
+ touches[i].y <<= 4;
+ touches[i].y |= buf[index + 1];
+ }
+}
+
+static irqreturn_t ektf2127_irq(int irq, void *dev_id)
+{
+ struct ektf2127_data *data = dev_id;
+ struct device *dev = &data->client->dev;
+ struct input_mt_pos touches[EKTF2127_MAX_TOUCHES];
+ int touch_count;
+ int slots[EKTF2127_MAX_TOUCHES];
+ char buff[EKTF2127_TOUCH_REPORT_SIZE];
+ int i, ret;
+
+ ret = i2c_master_recv(data->client, buff, EKTF2127_TOUCH_REPORT_SIZE);
+ if (ret != EKTF2127_TOUCH_REPORT_SIZE) {
+ dev_err(dev, "Error reading touch data\n");
+ return IRQ_HANDLED;
+ }
+
+ switch (buff[0]) {
+ case EKTF2127_REPORT:
+ /* Handled below */
+ break;
+ case EKTF2127_NOISE:
+ if (buff[1] == EKTF2127_ENV_NOISY)
+ dev_dbg(dev, "Environment is electically noisy\n");
+ return IRQ_HANDLED;
+ case EKTF2127_HELLO:
+ case EKTF2127_CALIB_DONE:
+ return IRQ_HANDLED;
+ default:
+ dev_err(dev, "Unexpected packet header byte %02x\n", buff[0]);
+ return IRQ_HANDLED;
+ }
+
+ touch_count = buff[1] & 0x07;
+
+ if (touch_count > EKTF2127_MAX_TOUCHES) {
+ dev_err(dev, "Too many touches %d > %d\n",
+ touch_count, EKTF2127_MAX_TOUCHES);
+ touch_count = EKTF2127_MAX_TOUCHES;
+ }
+
+ retrieve_coordinates(touches, touch_count, buff);
+ input_mt_assign_slots(data->input, slots, touches,
+ touch_count, 0);
+
+ for (i = 0; i < touch_count; i++) {
+ input_mt_slot(data->input, slots[i]);
+ input_mt_report_slot_state(data->input, MT_TOOL_FINGER, true);
+ touchscreen_report_pos(data->input, &data->prop, touches[i].x,
+ touches[i].y, true);
+ }
+
+ input_mt_sync_frame(data->input);
+ input_sync(data->input);
+
+ return IRQ_HANDLED;
+}
+
+static int ektf2127_start(struct input_dev *dev)
+{
+ struct ektf2127_data *data = input_get_drvdata(dev);
+
+ enable_irq(data->client->irq);
+ gpiod_set_value_cansleep(data->power_gpios, 1);
+
+ return 0;
+}
+
+static void ektf2127_stop(struct input_dev *dev)
+{
+ struct ektf2127_data *data = input_get_drvdata(dev);
+
+ disable_irq(data->client->irq);
+ gpiod_set_value_cansleep(data->power_gpios, 0);
+}
+
+static int ektf2127_suspend(struct device *dev)
+{
+ struct ektf2127_data *data = i2c_get_clientdata(to_i2c_client(dev));
+
+ mutex_lock(&data->input->mutex);
+ if (data->input->users)
+ ektf2127_stop(data->input);
+ mutex_unlock(&data->input->mutex);
+
+ return 0;
+}
+
+static int ektf2127_resume(struct device *dev)
+{
+ struct ektf2127_data *data = i2c_get_clientdata(to_i2c_client(dev));
+
+ mutex_lock(&data->input->mutex);
+ if (data->input->users)
+ ektf2127_start(data->input);
+ mutex_unlock(&data->input->mutex);
+
+ return 0;
+}
+
+static SIMPLE_DEV_PM_OPS(ektf2127_pm_ops, ektf2127_suspend,
+ ektf2127_resume);
+
+static int ektf2127_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct device *dev = &client->dev;
+ struct ektf2127_data *data;
+ struct input_dev *input;
+ char buff[4];
+ int error, max_x, max_y, ret = 0;
+
+ if (!client->irq) {
+ dev_err(dev, "Error no irq specified\n");
+ return -EINVAL;
+ }
+
+ data = devm_kzalloc(dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ /* This requests the gpio *and* turns on the touchscreen controller */
+ data->power_gpios = devm_gpiod_get(dev, "power", GPIOD_OUT_HIGH);
+ if (IS_ERR(data->power_gpios)) {
+ error = PTR_ERR(data->power_gpios);
+ if (error != -EPROBE_DEFER)
+ dev_err(dev, "Error getting power gpio: %d\n", error);
+ return error;
+ }
+
+ input = devm_input_allocate_device(dev);
+ if (!input)
+ return -ENOMEM;
+
+ input->name = client->name;
+ input->id.bustype = BUS_I2C;
+ input->open = ektf2127_start;
+ input->close = ektf2127_stop;
+
+ data->client = client;
+
+ /* Read hello (ignore result, depends on initial power state) */
+ msleep(20);
+ i2c_master_recv(data->client, buff, 4);
+
+ /* Read resolution from chip */
+
+ /* Request width */
+ buff[0] = EKTF2127_REQUEST;
+ buff[1] = EKTF2127_WIDTH;
+ buff[2] = 0x00;
+ buff[3] = 0x00;
+ ret = i2c_master_send(data->client, buff, 4);
+ if (ret != 4) {
+ dev_err(dev, "Error requesting width\n");
+ return ret < 0 ? ret : -EIO;
+ }
+
+ msleep(20);
+
+ /* Read response */
+ ret = i2c_master_recv(data->client, buff, 4);
+ if (ret != 4) {
+ dev_err(dev, "Error receiving width\n");
+ return ret < 0 ? ret : -EIO;
+ }
+
+ if ((buff[0] == EKTF2127_RESPONSE) && (buff[1] == EKTF2127_WIDTH)) {
+ max_x = (((buff[3] & 0xf0) << 4) | buff[2]) - 1;
+ } else {
+ dev_err(dev, "Error unexpected width data\n");
+ return -EIO;
+ }
+
+ /* Request height */
+ buff[0] = EKTF2127_REQUEST;
+ buff[1] = EKTF2127_HEIGHT;
+ buff[2] = 0x00;
+ buff[3] = 0x00;
+ ret = i2c_master_send(data->client, buff, 4);
+ if (ret != 4) {
+ dev_err(dev, "Error requesting height\n");
+ return ret < 0 ? ret : -EIO;
+ }
+
+ msleep(20);
+
+ /* Read response */
+ ret = i2c_master_recv(data->client, buff, 4);
+ if (ret != 4) {
+ dev_err(dev, "Error receiving height\n");
+ return ret < 0 ? ret : -EIO;
+ }
+
+ if ((buff[0] == EKTF2127_RESPONSE) && (buff[1] == EKTF2127_HEIGHT)) {
+ max_y = (((buff[3] & 0xf0) << 4) | buff[2]) - 1;
+ } else {
+ dev_err(dev, "Error unexpected height data\n");
+ return -EIO;
+ }
+
+ input_set_abs_params(input, ABS_MT_POSITION_X, 0, max_x, 0, 0);
+ input_set_abs_params(input, ABS_MT_POSITION_Y, 0, max_y, 0, 0);
+ touchscreen_parse_properties(input, true, &data->prop);
+
+ error = input_mt_init_slots(input, EKTF2127_MAX_TOUCHES,
+ INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED
+ | INPUT_MT_TRACK);
+ if (error)
+ return error;
+
+ data->input = input;
+ input_set_drvdata(input, data);
+
+ error = devm_request_threaded_irq(dev, client->irq, NULL, ektf2127_irq,
+ IRQF_ONESHOT, client->name, data);
+ if (error) {
+ dev_err(dev, "Error requesting irq: %d\n", error);
+ return error;
+ }
+
+ /* Stop device till opened */
+ ektf2127_stop(data->input);
+
+ error = input_register_device(input);
+ if (error)
+ return error;
+
+ i2c_set_clientdata(client, data);
+
+ return 0;
+}
+
+#ifdef CONFIG_OF
+static const struct of_device_id ektf2127_of_match[] = {
+ { .compatible = "elan,ektf2127" },
+ {}
+};
+MODULE_DEVICE_TABLE(of, ektf2127_of_match);
+#endif
+
+static const struct i2c_device_id ektf2127_i2c_id[] = {
+ { "ektf2127", 0 },
+ {}
+};
+MODULE_DEVICE_TABLE(i2c, ektf2127_i2c_id);
+
+static struct i2c_driver ektf2127_driver = {
+ .driver = {
+ .name = "elan_ektf2127",
+ .pm = &ektf2127_pm_ops,
+ .of_match_table = of_match_ptr(ektf2127_of_match),
+ },
+ .probe = ektf2127_probe,
+ .id_table = ektf2127_i2c_id,
+};
+
+module_i2c_driver(ektf2127_driver);
+
+MODULE_DESCRIPTION("ELAN eKTF2127 I2C Touchscreen Driver");
+MODULE_AUTHOR("Michel Verlaan, Siebren Vroegindeweij");
+MODULE_LICENSE("GPL");
--
2.9.3
^ permalink raw reply related
* [PATCH resend 4/5] input: touchscreen: silead: Add regulator support
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911184408.11657-1-hdegoede@redhat.com>
On some tablets the touchscreen controller is powered by seperate
regulators, add support for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Rob Herring <robh@kernel.org>
---
.../bindings/input/touchscreen/silead_gsl1680.txt | 2 +
drivers/input/touchscreen/silead.c | 51 ++++++++++++++++++++--
2 files changed, 49 insertions(+), 4 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt b/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
index 820fee4..ce85ee5 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/silead_gsl1680.txt
@@ -18,6 +18,8 @@ Optional properties:
- touchscreen-inverted-y : See touchscreen.txt
- touchscreen-swapped-x-y : See touchscreen.txt
- silead,max-fingers : maximum number of fingers the touchscreen can detect
+- vddio-supply : regulator phandle for controller VDDIO
+- avdd-supply : regulator phandle for controller AVDD
Example:
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index f502c84..c6a1ae9 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -29,6 +29,7 @@
#include <linux/input/touchscreen.h>
#include <linux/pm.h>
#include <linux/irq.h>
+#include <linux/regulator/consumer.h>
#include <asm/unaligned.h>
@@ -72,6 +73,8 @@ enum silead_ts_power {
struct silead_ts_data {
struct i2c_client *client;
struct gpio_desc *gpio_power;
+ struct regulator *vddio;
+ struct regulator *avdd;
struct input_dev *input;
char fw_name[64];
struct touchscreen_properties prop;
@@ -465,21 +468,52 @@ static int silead_ts_probe(struct i2c_client *client,
if (client->irq <= 0)
return -ENODEV;
+ data->vddio = devm_regulator_get_optional(dev, "vddio");
+ if (IS_ERR(data->vddio)) {
+ if (PTR_ERR(data->vddio) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+ data->vddio = NULL;
+ }
+
+ data->avdd = devm_regulator_get_optional(dev, "avdd");
+ if (IS_ERR(data->avdd)) {
+ if (PTR_ERR(data->avdd) == -EPROBE_DEFER)
+ return -EPROBE_DEFER;
+ data->avdd = NULL;
+ }
+
+ /*
+ * Enable regulators at probe and disable them at remove, we need
+ * to keep the chip powered otherwise it forgets its firmware.
+ */
+ if (data->vddio) {
+ error = regulator_enable(data->vddio);
+ if (error)
+ return error;
+ }
+
+ if (data->avdd) {
+ error = regulator_enable(data->avdd);
+ if (error)
+ goto disable_vddio;
+ }
+
/* Power GPIO pin */
data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
if (IS_ERR(data->gpio_power)) {
if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
dev_err(dev, "Shutdown GPIO request failed\n");
- return PTR_ERR(data->gpio_power);
+ error = PTR_ERR(data->gpio_power);
+ goto disable_avdd;
}
error = silead_ts_setup(client);
if (error)
- return error;
+ goto disable_avdd;
error = silead_ts_request_input_dev(data);
if (error)
- return error;
+ goto disable_avdd;
error = devm_request_threaded_irq(dev, client->irq,
NULL, silead_ts_threaded_irq_handler,
@@ -487,10 +521,19 @@ static int silead_ts_probe(struct i2c_client *client,
if (error) {
if (error != -EPROBE_DEFER)
dev_err(dev, "IRQ request failed %d\n", error);
- return error;
+ goto disable_avdd;
}
return 0;
+
+disable_avdd:
+ if (data->avdd)
+ regulator_disable(data->avdd);
+disable_vddio:
+ if (data->vddio)
+ regulator_disable(data->vddio);
+
+ return error;
}
static int __maybe_unused silead_ts_suspend(struct device *dev)
--
2.9.3
^ permalink raw reply related
* [PATCH resend 3/5] input: touchscreen: edt-ft5x06: Add support for softbuttons
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911184408.11657-1-hdegoede@redhat.com>
Add support for softbuttons to the edt-ft5x06 driver.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/touchscreen/edt-ft5x06.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 28466e3..481d8ba 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -86,6 +86,7 @@ struct edt_reg_addr {
struct edt_ft5x06_ts_data {
struct i2c_client *client;
struct input_dev *input;
+ struct touchscreen_softbutton_info *buttons;
struct touchscreen_properties prop;
u16 num_x;
u16 num_y;
@@ -241,6 +242,9 @@ static irqreturn_t edt_ft5x06_ts_isr(int irq, void *dev_id)
id = (buf[2] >> 4) & 0x0f;
down = type != TOUCH_EVENT_UP;
+ if (touchscreen_handle_softbuttons(tsdata->buttons, x, y, down))
+ continue;
+
input_mt_slot(tsdata->input, id);
input_mt_report_slot_state(tsdata->input, MT_TOOL_FINGER, down);
@@ -975,6 +979,10 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client,
touchscreen_parse_properties(input, true, &tsdata->prop);
+ tsdata->buttons = devm_touchscreen_alloc_softbuttons(input);
+ if (IS_ERR(tsdata->buttons))
+ return PTR_ERR(tsdata->buttons);
+
error = input_mt_init_slots(input, tsdata->max_support_points,
INPUT_MT_DIRECT);
if (error) {
--
2.9.3
^ permalink raw reply related
* [PATCH resend 2/5] input: touchscreen: Add LED trigger support to the softbutton code
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911184408.11657-1-hdegoede@redhat.com>
In some hardware there are 1 or more LEDs behind the touchscreen
softbuttons, which are intended to provide visual feedback to the
user that the softbutton has been pressed, this commit adds support
for this.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
.../bindings/input/touchscreen/softbuttons.txt | 4 ++
drivers/input/touchscreen/softbuttons.c | 49 +++++++++++++++++++++-
2 files changed, 52 insertions(+), 1 deletion(-)
diff --git a/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt b/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
index 3eb6f4c..b425b95 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
+++ b/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
@@ -17,6 +17,10 @@ Required subnode-properties:
- softbutton-min-y : Y start of the area the softbutton area covers
- softbutton-max-y : Y end of the area the softbutton area covers
+Optional subnode-properties:
+- linux,led-trigger : String for a LED trigger for providing visual
+ feedback that the softbutton has been pressed
+
Example:
#include <dt-bindings/input/input.h>
diff --git a/drivers/input/touchscreen/softbuttons.c b/drivers/input/touchscreen/softbuttons.c
index 47aea18..9a3fbfa 100644
--- a/drivers/input/touchscreen/softbuttons.c
+++ b/drivers/input/touchscreen/softbuttons.c
@@ -11,6 +11,7 @@
#include <linux/input.h>
#include <linux/input/touchscreen.h>
+#include <linux/leds.h>
#include <linux/of.h>
struct touchscreen_softbutton {
@@ -19,6 +20,8 @@ struct touchscreen_softbutton {
u32 min_y;
u32 max_y;
u32 keycode;
+ const char *ledtrigger_name;
+ struct led_trigger *ledtrigger;
};
struct touchscreen_softbutton_info {
@@ -48,7 +51,7 @@ struct touchscreen_softbutton_info *devm_touchscreen_alloc_softbuttons(
struct device *dev = input->dev.parent;
struct device_node *np, *pp;
struct touchscreen_softbutton_info *info;
- int i, err, button_count;
+ int i, j, err, button_count;
np = dev->of_node;
if (!np)
@@ -103,6 +106,36 @@ struct touchscreen_softbutton_info *devm_touchscreen_alloc_softbuttons(
dev_err(dev, "%s: Inval max-y prop\n", pp->name);
return ERR_PTR(-EINVAL);
}
+
+ err = of_property_read_string(pp, "linux,led-trigger",
+ &btn->ledtrigger_name);
+ if (err)
+ continue; /* The LED trigger is optional */
+
+ /* Check if another softbutton uses the same trigger */
+ for (j = 0; j < i; j++) {
+ if (info->buttons[j].ledtrigger_name &&
+ strcmp(info->buttons[j].ledtrigger_name,
+ btn->ledtrigger_name) == 0) {
+ btn->ledtrigger = info->buttons[j].ledtrigger;
+ break;
+ }
+ }
+ if (!btn->ledtrigger) {
+ btn->ledtrigger =
+ devm_kzalloc(dev, sizeof(*btn->ledtrigger),
+ GFP_KERNEL);
+ if (!btn->ledtrigger)
+ return ERR_PTR(-ENOMEM);
+
+ btn->ledtrigger->name = btn->ledtrigger_name;
+ err = devm_led_trigger_register(dev, btn->ledtrigger);
+ if (err) {
+ dev_err(dev, "%s: Ledtrigger register error\n",
+ pp->name);
+ return ERR_PTR(err);
+ }
+ }
}
__set_bit(EV_KEY, input->evbit);
@@ -126,6 +159,7 @@ bool touchscreen_handle_softbuttons(struct touchscreen_softbutton_info *info,
unsigned int x, unsigned int y, bool down)
{
int i;
+ unsigned long led_delay = 1000; /* Keep the led on 1s after release */
if (info == NULL)
return false;
@@ -137,6 +171,19 @@ bool touchscreen_handle_softbuttons(struct touchscreen_softbutton_info *info,
y <= info->buttons[i].max_y) {
input_report_key(info->input,
info->buttons[i].keycode, down);
+
+ if (info->buttons[i].ledtrigger && down) {
+ led_trigger_event(info->buttons[i].ledtrigger,
+ LED_FULL);
+ } else if (info->buttons[i].ledtrigger && !down) {
+ /* Led must be off before calling blink */
+ led_trigger_event(info->buttons[i].ledtrigger,
+ LED_OFF);
+ led_trigger_blink_oneshot(
+ info->buttons[i].ledtrigger,
+ &led_delay, &led_delay, 0);
+ }
+
return true;
}
}
--
2.9.3
^ permalink raw reply related
* [PATCH resend 1/5] input: touchscreen: Add generic touchscreen softbutton handling code
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911184408.11657-1-hdegoede@redhat.com>
Some touchscreens extend over the display they cover and have a number
of capacative softbuttons outside of the display the cover.
With some hardware these softbuttons simply report touches with
coordinates outside of the normal coordinate space for touches on the
display.
This commit adds a devicetree binding for describing such buttons in
devicetree and a bunch of helper functions to easily add support for
these to existing touchscreen drivers.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
.../bindings/input/touchscreen/softbuttons.txt | 58 +++++++++
drivers/input/touchscreen/Makefile | 2 +-
drivers/input/touchscreen/softbuttons.c | 145 +++++++++++++++++++++
include/linux/input/touchscreen.h | 9 ++
4 files changed, 213 insertions(+), 1 deletion(-)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
create mode 100644 drivers/input/touchscreen/softbuttons.c
diff --git a/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt b/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
new file mode 100644
index 0000000..3eb6f4c
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/softbuttons.txt
@@ -0,0 +1,58 @@
+General Touchscreen Softbutton Properties:
+
+Some touchscreens extend over the display they cover and have a number
+of capacative softbuttons outside of the display the cover.
+
+Some of these softbuttons simply report touches with coordinates outside of
+the normal coordinate space for touches on the display. This binding is for
+describing such buttons in devicetree.
+
+Each softkey is represented as a sub-node of the touchscreen node.
+
+Required subnode-properties:
+ - label : Descriptive name of the key.
+ - linux,code : Keycode to emit.
+ - softbutton-min-x : X start of the area the softbutton area covers
+ - softbutton-max-x : X end of the area the softbutton area covers
+ - softbutton-min-y : Y start of the area the softbutton area covers
+ - softbutton-max-y : Y end of the area the softbutton area covers
+
+Example:
+
+#include <dt-bindings/input/input.h>
+
+&i2c2 {
+ ft5406ee8: touchscreen at 38 {
+ compatible = "edt,edt-ft5406";
+ reg = <0x38>;
+ touchscreen-size-x = <1024>;
+ touchscreen-size-y = <768>;
+
+ button at 0 {
+ label = "Esc";
+ linux,code = <KEY_ESC>;
+ softbutton-min-x = <1084>;
+ softbutton-max-x = <1098>;
+ softbutton-min-y = <0>;
+ softbutton-max-y = <49>;
+ };
+
+ button at 1 {
+ label = "Home";
+ linux,code = <KEY_HOMEPAGE>;
+ softbutton-min-x = <1084>;
+ softbutton-max-x = <1098>;
+ softbutton-min-y = <50>;
+ softbutton-max-y = <99>;
+ };
+
+ button at 2 {
+ label = "Menu";
+ linux,code = <KEY_MENU>;
+ softbutton-min-x = <1084>;
+ softbutton-max-x = <1098>;
+ softbutton-min-y = <100>;
+ softbutton-max-y = <149>;
+ };
+ };
+};
diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile
index 57a1c09..33b2eb8 100644
--- a/drivers/input/touchscreen/Makefile
+++ b/drivers/input/touchscreen/Makefile
@@ -6,7 +6,7 @@
wm97xx-ts-y := wm97xx-core.o
-obj-$(CONFIG_TOUCHSCREEN_PROPERTIES) += of_touchscreen.o
+obj-$(CONFIG_TOUCHSCREEN_PROPERTIES) += of_touchscreen.o softbuttons.o
obj-$(CONFIG_TOUCHSCREEN_88PM860X) += 88pm860x-ts.o
obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o
obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o
diff --git a/drivers/input/touchscreen/softbuttons.c b/drivers/input/touchscreen/softbuttons.c
new file mode 100644
index 0000000..47aea18
--- /dev/null
+++ b/drivers/input/touchscreen/softbuttons.c
@@ -0,0 +1,145 @@
+/*
+ * touchscreen softbutton helper functions
+ *
+ * Copyright (c) 2016 Hans de Goede <hdegoede@redhat.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/input.h>
+#include <linux/input/touchscreen.h>
+#include <linux/of.h>
+
+struct touchscreen_softbutton {
+ u32 min_x;
+ u32 max_x;
+ u32 min_y;
+ u32 max_y;
+ u32 keycode;
+};
+
+struct touchscreen_softbutton_info {
+ struct input_dev *input;
+ struct touchscreen_softbutton *buttons;
+ int button_count;
+};
+
+/**
+ * devm_touchscreen_alloc_softbuttons - allocate softbuttons
+ * @input: touchscreen input device for which softbuttons should be allocated
+ *
+ * This function parses touschcreen softbutton DT properties for touchscreens
+ * and allocates and fill a touchscreen_softbutton_info struct if any
+ * softbuttons are found.
+ *
+ * Returns prepared struct touchscreen_softbutton_info on success,
+ * %NULL if no softbuttons were found (this is not an error) or a ERR_PTR
+ * in case of an error.
+ *
+ * Note as this is a devm function the returned pointer does not need to
+ * be freed.
+ */
+struct touchscreen_softbutton_info *devm_touchscreen_alloc_softbuttons(
+ struct input_dev *input)
+{
+ struct device *dev = input->dev.parent;
+ struct device_node *np, *pp;
+ struct touchscreen_softbutton_info *info;
+ int i, err, button_count;
+
+ np = dev->of_node;
+ if (!np)
+ return NULL;
+
+ button_count = of_get_child_count(np);
+ if (button_count == 0)
+ return NULL;
+
+ info = devm_kzalloc(dev, sizeof(*info), GFP_KERNEL);
+ if (!info)
+ return ERR_PTR(-ENOMEM);
+
+ info->input = input;
+ info->button_count = button_count;
+ info->buttons = devm_kzalloc(dev, button_count * sizeof(*info->buttons),
+ GFP_KERNEL);
+ if (!info->buttons)
+ return ERR_PTR(-ENOMEM);
+
+ for (pp = of_get_next_child(np, NULL), i = 0;
+ pp != NULL;
+ pp = of_get_next_child(np, pp), i++) {
+ struct touchscreen_softbutton *btn = &info->buttons[i];
+
+ err = of_property_read_u32(pp, "linux,code", &btn->keycode);
+ if (err) {
+ dev_err(dev, "%s: Inval linux,code prop\n", pp->name);
+ return ERR_PTR(-EINVAL);
+ }
+
+ err = of_property_read_u32(pp, "softbutton-min-x", &btn->min_x);
+ if (err) {
+ dev_err(dev, "%s: Inval min-x prop\n", pp->name);
+ return ERR_PTR(-EINVAL);
+ }
+
+ err = of_property_read_u32(pp, "softbutton-max-x", &btn->max_x);
+ if (err) {
+ dev_err(dev, "%s: Inval max-x prop\n", pp->name);
+ return ERR_PTR(-EINVAL);
+ }
+
+ err = of_property_read_u32(pp, "softbutton-min-y", &btn->min_y);
+ if (err) {
+ dev_err(dev, "%s: Inval min-y prop\n", pp->name);
+ return ERR_PTR(-EINVAL);
+ }
+
+ err = of_property_read_u32(pp, "softbutton-max-y", &btn->max_y);
+ if (err) {
+ dev_err(dev, "%s: Inval max-y prop\n", pp->name);
+ return ERR_PTR(-EINVAL);
+ }
+ }
+
+ __set_bit(EV_KEY, input->evbit);
+ for (i = 0; i < info->button_count; i++)
+ __set_bit(info->buttons[i].keycode, input->keybit);
+
+ return info;
+}
+
+/**
+ * touchscreen_handle_softbuttons - check for softbutton press
+ * @info: softbutton info retured by devm_touchscreen_alloc_softbuttons.
+ *
+ * This function checks if the passed in coordinates match any softbutton,
+ * and when they do reports a key press / release for the softbutton.
+ *
+ * Returns true if the coordinates match a softbutton and a key press / release
+ * was reported, false otherwise.
+ */
+bool touchscreen_handle_softbuttons(struct touchscreen_softbutton_info *info,
+ unsigned int x, unsigned int y, bool down)
+{
+ int i;
+
+ if (info == NULL)
+ return false;
+
+ for (i = 0; i < info->button_count; i++) {
+ if (x >= info->buttons[i].min_x &&
+ x <= info->buttons[i].max_x &&
+ y >= info->buttons[i].min_y &&
+ y <= info->buttons[i].max_y) {
+ input_report_key(info->input,
+ info->buttons[i].keycode, down);
+ return true;
+ }
+ }
+
+ return false;
+}
diff --git a/include/linux/input/touchscreen.h b/include/linux/input/touchscreen.h
index 09d22cc..0b9d4ee 100644
--- a/include/linux/input/touchscreen.h
+++ b/include/linux/input/touchscreen.h
@@ -9,8 +9,11 @@
#ifndef _TOUCHSCREEN_H
#define _TOUCHSCREEN_H
+#include <linux/types.h>
+
struct input_dev;
struct input_mt_pos;
+struct touchscreen_softbutton_info;
struct touchscreen_properties {
unsigned int max_x;
@@ -32,4 +35,10 @@ void touchscreen_report_pos(struct input_dev *input,
unsigned int x, unsigned int y,
bool multitouch);
+struct touchscreen_softbutton_info *devm_touchscreen_alloc_softbuttons(
+ struct input_dev *input);
+
+bool touchscreen_handle_softbuttons(struct touchscreen_softbutton_info *info,
+ unsigned int x, unsigned int y, bool down);
+
#endif
--
2.9.3
^ permalink raw reply related
* [PATCH resend 0/5] input: resend of 5 touchscreen patches
From: Hans de Goede @ 2016-09-11 18:44 UTC (permalink / raw)
To: linux-arm-kernel
Hi Dmitry,
Thank you for merging the 2 silead touchscreen firmware loading patches
into your for-linus branch.
Here is a resend of 5 patches intended for next, which do not seem to
be getting anywhere hence the resend. Esp. patches 4 and 5, which
already have Robh's ack for the dt bits seem ready for merging to me.
Rob, patches 1, 2 have a dt-bindings component, you had some questions
about the dt bits in patch 1, which I've answered here:
http://www.spinics.net/lists/arm-kernel/msg521450.html
Regards,
Hans
p.s.
Thank you both for all the great work you're doing on the kernel.
^ permalink raw reply
* [PATCH v4 5/5] ARM: dts: imx6qdl-icore: Add usbotg support
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473618641-10159-1-git-send-email-jagan@amarulasolutions.com>
Add usbotg support for Engicam i.CoreM6 dql modules.
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- Newly added patch
arch/arm/boot/dts/imx6qdl-icore.dtsi | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi
index b4f7e64..fefd7fd 100644
--- a/arch/arm/boot/dts/imx6qdl-icore.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi
@@ -65,6 +65,15 @@
regulator-boot-on;
regulator-always-on;
};
+
+ reg_usb_otg_vbus: usb_otg_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_otg_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
};
&can1 {
@@ -125,6 +134,14 @@
status = "okay";
};
+&usbotg {
+ vbus-supply = <®_usb_otg_vbus>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usbotg>;
+ disable-over-current;
+ status = "okay";
+};
+
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
@@ -199,6 +216,12 @@
>;
};
+ pinctrl_usbotg: usbotggrp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_1__USB_OTG_ID 0x17059
+ >;
+ };
+
pinctrl_usdhc1: usdhc1grp {
fsl,pins = <
MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17070
--
2.7.4
^ permalink raw reply related
* [PATCH v4 4/5] ARM: dts: imx6qdl-icore: Add usbhost support
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473618641-10159-1-git-send-email-jagan@amarulasolutions.com>
Add usbhost support for Engicam i.CoreM6 dql modules.
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- Newly added patch
arch/arm/boot/dts/imx6qdl-icore.dtsi | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi
index b99ee0b..b4f7e64 100644
--- a/arch/arm/boot/dts/imx6qdl-icore.dtsi
+++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi
@@ -56,6 +56,15 @@
regulator-boot-on;
regulator-always-on;
};
+
+ reg_usb_h1_vbus: usb_h1_vbus {
+ compatible = "regulator-fixed";
+ regulator-name = "usb_h1_vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
};
&can1 {
@@ -110,6 +119,12 @@
status = "okay";
};
+&usbh1 {
+ vbus-supply = <®_usb_h1_vbus>;
+ disable-over-current;
+ status = "okay";
+};
+
&usdhc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_usdhc1>;
--
2.7.4
^ permalink raw reply related
* [PATCH v4 3/5] ARM: dts: imx6q: Add Engicam i.CoreM6 DualLite/Solo initial support
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473618641-10159-1-git-send-email-jagan@amarulasolutions.com>
i.CoreM6 DualLite/Solo modules are system on module solutions manufactured
by Engicam with following characteristics:
CPU NXP i.MX6 DL, 800MHz
RAM 1GB, 32, 64 bit, DDR3-800/1066
NAND SLC,512MB
Power supply Single 5V
MAX LCD RES FULLHD
and more info at
http://www.engicam.com/en/products/embedded/som/sodimm/i-core-m6s-dl-d-q
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- Newly added patch
Changes for v3:
- Use compatible as engicam,imx6-icore instead of fsl,imx6-icore
Changes for v2:
- s/oaky/okay/g
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/imx6dl-icore.dts | 59 ++++++++++++++++++++++++++++++++++++++
2 files changed, 60 insertions(+)
create mode 100644 arch/arm/boot/dts/imx6dl-icore.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index 511510d..6175f44 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -333,6 +333,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6dl-gw552x.dtb \
imx6dl-gw553x.dtb \
imx6dl-hummingboard.dtb \
+ imx6dl-icore.dtb \
imx6dl-nit6xlite.dtb \
imx6dl-nitrogen6x.dtb \
imx6dl-phytec-pbab01.dtb \
diff --git a/arch/arm/boot/dts/imx6dl-icore.dts b/arch/arm/boot/dts/imx6dl-icore.dts
new file mode 100644
index 0000000..aec332c
--- /dev/null
+++ b/arch/arm/boot/dts/imx6dl-icore.dts
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "imx6dl.dtsi"
+#include "imx6qdl-icore.dtsi"
+
+/ {
+ model = "Engicam i.CoreM6 DualLite/Solo Starter Kit";
+ compatible = "engicam,imx6-icore", "fsl,imx6dl";
+};
+
+&can1 {
+ status = "okay";
+};
+
+&can2 {
+ status = "okay";
+};
--
2.7.4
^ permalink raw reply related
* [PATCH v4 2/5] ARM: dts: imx6q: Add Engicam i.CoreM6 Quad/Dual initial support
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473618641-10159-1-git-send-email-jagan@amarulasolutions.com>
i.CoreM6 Quad/Dual modules are system on module solutions manufactured
by Engicam with following characteristics:
CPU NXP i.MX6 DQ, 800MHz
RAM 1GB, 32, 64 bit, DDR3-800/1066
NAND SLC,512MB
Power supply Single 5V
MAX LCD RES FULLHD
and more info at
http://www.engicam.com/en/products/embedded/som/sodimm/i-core-m6s-dl-d-q
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- Newly added patch
Changes for v3:
- Use compatible as engicam,imx6-icore instead of fsl,imx6-icore
- Update IOMUX value for can1 and can2 nodes
- Added reg_3p3v for can1 and can2 nodes
Changes for v2:
- s/oaky/okay/g
arch/arm/boot/dts/Makefile | 1 +
arch/arm/boot/dts/imx6q-icore.dts | 59 +++++++++++
arch/arm/boot/dts/imx6qdl-icore.dtsi | 197 +++++++++++++++++++++++++++++++++++
3 files changed, 257 insertions(+)
create mode 100644 arch/arm/boot/dts/imx6q-icore.dts
create mode 100644 arch/arm/boot/dts/imx6qdl-icore.dtsi
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index f79cac2..511510d 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -374,6 +374,7 @@ dtb-$(CONFIG_SOC_IMX6Q) += \
imx6q-gw553x.dtb \
imx6q-h100.dtb \
imx6q-hummingboard.dtb \
+ imx6q-icore.dtb \
imx6q-icore-rqs.dtb \
imx6q-marsboard.dtb \
imx6q-nitrogen6x.dtb \
diff --git a/arch/arm/boot/dts/imx6q-icore.dts b/arch/arm/boot/dts/imx6q-icore.dts
new file mode 100644
index 0000000..025f543
--- /dev/null
+++ b/arch/arm/boot/dts/imx6q-icore.dts
@@ -0,0 +1,59 @@
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+/dts-v1/;
+
+#include "imx6q.dtsi"
+#include "imx6qdl-icore.dtsi"
+
+/ {
+ model = "Engicam i.CoreM6 Quad/Dual Starter Kit";
+ compatible = "engicam,imx6-icore", "fsl,imx6q";
+};
+
+&can1 {
+ status = "okay";
+};
+
+&can2 {
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx6qdl-icore.dtsi b/arch/arm/boot/dts/imx6qdl-icore.dtsi
new file mode 100644
index 0000000..b99ee0b
--- /dev/null
+++ b/arch/arm/boot/dts/imx6qdl-icore.dtsi
@@ -0,0 +1,197 @@
+/*
+ * Copyright (C) 2016 Amarula Solutions B.V.
+ * Copyright (C) 2016 Engicam S.r.l.
+ *
+ * This file is dual-licensed: you can use it either under the terms
+ * of the GPL or the X11 license, at your option. Note that this dual
+ * licensing only applies to this file, and not this project as a
+ * whole.
+ *
+ * a) This file is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2 as published by the Free Software Foundation.
+ *
+ * This file is distributed in the hope that it will be useful
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * Or, alternatively
+ *
+ * b) Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation
+ * files (the "Software"), to deal in the Software without
+ * restriction, including without limitation the rights to use
+ * copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following
+ * conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+
+/ {
+ memory {
+ reg = <0x10000000 0x80000000>;
+ };
+
+ reg_3p3v: regulator-3p3v {
+ compatible = "regulator-fixed";
+ regulator-name = "3P3V";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-boot-on;
+ regulator-always-on;
+ };
+};
+
+&can1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_flexcan1>;
+ xceiver-supply = <®_3p3v>;
+};
+
+&can2 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_flexcan2>;
+ xceiver-supply = <®_3p3v>;
+};
+
+&clks {
+ assigned-clocks = <&clks IMX6QDL_CLK_LVDS2_SEL>;
+ assigned-clock-parents = <&clks IMX6QDL_CLK_OSC>;
+};
+
+&gpmi {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_gpmi_nand>;
+ fsl,legacy-bch-geometry;
+ nand-on-flash-bbt;
+ status = "okay";
+};
+
+&i2c1 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c1>;
+ status = "okay";
+};
+
+&i2c2 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c2>;
+ status = "okay";
+};
+
+&i2c3 {
+ clock-frequency = <100000>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_i2c3>;
+ status = "okay";
+};
+
+&uart4 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_uart4>;
+ status = "okay";
+};
+
+&usdhc1 {
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_usdhc1>;
+ cd-gpios = <&gpio1 1 GPIO_ACTIVE_LOW>;
+ no-1-8-v;
+ status = "okay";
+};
+
+&iomuxc {
+ pinctrl_flexcan1: flexcan1grp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_ROW2__FLEXCAN1_RX 0x1b020
+ MX6QDL_PAD_KEY_COL2__FLEXCAN1_TX 0x1b020
+ >;
+ };
+
+ pinctrl_flexcan2: flexcan2grp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_COL4__FLEXCAN2_TX 0x1b020
+ MX6QDL_PAD_KEY_ROW4__FLEXCAN2_RX 0x1b020
+ >;
+ };
+
+ pinctrl_gpmi_nand: gpmi-nand {
+ fsl,pins = <
+ MX6QDL_PAD_NANDF_CLE__NAND_CLE 0xb0b1
+ MX6QDL_PAD_NANDF_ALE__NAND_ALE 0xb0b1
+ MX6QDL_PAD_NANDF_WP_B__NAND_WP_B 0xb0b1
+ MX6QDL_PAD_NANDF_RB0__NAND_READY_B 0xb000
+ MX6QDL_PAD_NANDF_CS0__NAND_CE0_B 0xb0b1
+ MX6QDL_PAD_NANDF_CS1__NAND_CE1_B 0xb0b1
+ MX6QDL_PAD_SD4_CMD__NAND_RE_B 0xb0b1
+ MX6QDL_PAD_SD4_CLK__NAND_WE_B 0xb0b1
+ MX6QDL_PAD_NANDF_D0__NAND_DATA00 0xb0b1
+ MX6QDL_PAD_NANDF_D1__NAND_DATA01 0xb0b1
+ MX6QDL_PAD_NANDF_D2__NAND_DATA02 0xb0b1
+ MX6QDL_PAD_NANDF_D3__NAND_DATA03 0xb0b1
+ MX6QDL_PAD_NANDF_D4__NAND_DATA04 0xb0b1
+ MX6QDL_PAD_NANDF_D5__NAND_DATA05 0xb0b1
+ MX6QDL_PAD_NANDF_D6__NAND_DATA06 0xb0b1
+ MX6QDL_PAD_NANDF_D7__NAND_DATA07 0xb0b1
+ MX6QDL_PAD_SD4_DAT0__NAND_DQS 0x00b1
+ >;
+ };
+
+ pinctrl_i2c1: i2c1grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_D21__I2C1_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D28__I2C1_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c2: i2c2grp {
+ fsl,pins = <
+ MX6QDL_PAD_EIM_EB2__I2C2_SCL 0x4001b8b1
+ MX6QDL_PAD_KEY_ROW3__I2C2_SDA 0x4001b8b1
+ >;
+ };
+
+ pinctrl_i2c3: i2c3grp {
+ fsl,pins = <
+ MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
+ MX6QDL_PAD_EIM_D18__I2C3_SDA 0x4001b8b1
+ MX6QDL_PAD_GPIO_0__CCM_CLKO1 0x130b0
+ >;
+ };
+
+ pinctrl_uart4: uart4grp {
+ fsl,pins = <
+ MX6QDL_PAD_KEY_COL0__UART4_TX_DATA 0x1b0b1
+ MX6QDL_PAD_KEY_ROW0__UART4_RX_DATA 0x1b0b1
+ >;
+ };
+
+ pinctrl_usdhc1: usdhc1grp {
+ fsl,pins = <
+ MX6QDL_PAD_SD1_CMD__SD1_CMD 0x17070
+ MX6QDL_PAD_SD1_CLK__SD1_CLK 0x10070
+ MX6QDL_PAD_SD1_DAT0__SD1_DATA0 0x17070
+ MX6QDL_PAD_SD1_DAT1__SD1_DATA1 0x17070
+ MX6QDL_PAD_SD1_DAT2__SD1_DATA2 0x17070
+ MX6QDL_PAD_SD1_DAT3__SD1_DATA3 0x17070
+ >;
+ };
+};
--
2.7.4
^ permalink raw reply related
* [PATCH v4 1/5] of: Add vendor prefix for Engicam s.r.l company
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473618641-10159-1-git-send-email-jagan@amarulasolutions.com>
Engicam providing design services of electronic systems with
high content of technology, relying on a long experience in
electronic design.
For more info visit
http://www.engicam.com/en/
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Matteo Lisi <matteo.lisi@engicam.com>
Cc: Michael Trimarchi <michael@amarulasolutions.com>
Signed-off-by: Jagan Teki <jagan@amarulasolutions.com>
---
Changes for v4:
- none
Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 3003f33..327e4c7 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -85,6 +85,7 @@ elan Elan Microelectronic Corp.
embest Shenzhen Embest Technology Co., Ltd.
emmicro EM Microelectronic
energymicro Silicon Laboratories (formerly Energy Micro AS)
+engicam Engicam S.r.l.
epcos EPCOS AG
epfl Ecole Polytechnique F?d?rale de Lausanne
epson Seiko Epson Corp.
--
2.7.4
^ permalink raw reply related
* [PATCH v4 0/5] ARM: dts: imx6q: Add Engicam i.CoreM6 dts
From: Jagan Teki @ 2016-09-11 18:30 UTC (permalink / raw)
To: linux-arm-kernel
This is series add dts support for Engicam I.Core M6 qdl modules.
Jagan Teki (5):
of: Add vendor prefix for Engicam s.r.l company
ARM: dts: imx6q: Add Engicam i.CoreM6 Quad/Dual initial support
ARM: dts: imx6q: Add Engicam i.CoreM6 DualLite/Solo initial support
ARM: dts: imx6qdl-icore: Add usbhost support
ARM: dts: imx6qdl-icore: Add usbotg support
.../devicetree/bindings/vendor-prefixes.txt | 1 +
arch/arm/boot/dts/Makefile | 2 +
arch/arm/boot/dts/imx6dl-icore.dts | 59 ++++++
arch/arm/boot/dts/imx6q-icore.dts | 59 ++++++
arch/arm/boot/dts/imx6qdl-icore.dtsi | 235 +++++++++++++++++++++
5 files changed, 356 insertions(+)
create mode 100644 arch/arm/boot/dts/imx6dl-icore.dts
create mode 100644 arch/arm/boot/dts/imx6q-icore.dts
create mode 100644 arch/arm/boot/dts/imx6qdl-icore.dtsi
--
2.7.4
^ permalink raw reply
* [PATCH 5/5] ARM: dts: sun8i: Add touchscreen node for sun8i-a33-ga10h
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911182327.824-1-hdegoede@redhat.com>
The ga10h tablet has a gsl3675 touchscreen, add a dt node describing it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts b/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts
index de6269d..f711599 100644
--- a/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts
+++ b/arch/arm/boot/dts/sun8i-a33-ga10h-v1.1.dts
@@ -58,6 +58,16 @@
status = "okay";
};
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl3675";
+ firmware-name = "gsl3675-ga10h.fw";
+ touchscreen-size-x = <1630>;
+ touchscreen-size-y = <990>;
+ touchscreen-inverted-y;
+ status = "okay";
+};
+
&lradc {
button at 600 {
label = "Back";
--
2.9.3
^ permalink raw reply related
* [PATCH 4/5] ARM: dts: sun8i: Add touchscreen node for sun8i-a23-polaroid-mid2809pxe04
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911182327.824-1-hdegoede@redhat.com>
Add a node enabling the gsl3670 touchscreen controller found on
sun8i-a23-polaroid-mid2809pxe04 tablets.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts b/arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts
index c9213ca..9955f85 100644
--- a/arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts
+++ b/arch/arm/boot/dts/sun8i-a23-polaroid-mid2809pxe04.dts
@@ -90,3 +90,12 @@
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
};
+
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl3670";
+ firmware-name = "gsl3670-polaroid-mid2809pxe04.fw";
+ touchscreen-size-x = <1660>;
+ touchscreen-size-y = <890>;
+ status = "okay";
+};
--
2.9.3
^ permalink raw reply related
* [PATCH 3/5] ARM: dts: sun8i: Add touchscreen node for sun8i-a23-polaroid-mid2407pxe03
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911182327.824-1-hdegoede@redhat.com>
Add a node enabling the gsl1680 touchscreen controller found on
sun8i-a23-polaroid-mid2407pxe03 tablets.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
Changes in v2:
-Make ldo_io1 vddio-supply for the touchscreen rather then marking it as
regulator-always-on
---
arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts b/arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts
index 4789aac..6662127 100644
--- a/arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts
+++ b/arch/arm/boot/dts/sun8i-a23-polaroid-mid2407pxe03.dts
@@ -90,3 +90,22 @@
allwinner,pull = <SUN4I_PINCTRL_NO_PULL>;
};
};
+
+®_ldo_io1 {
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-touchscreen";
+ status = "okay";
+};
+
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl1680";
+ firmware-name = "gsl1680-polaroid-mid2407pxe03.fw";
+ touchscreen-size-x = <960>;
+ touchscreen-size-y = <640>;
+ touchscreen-inverted-x;
+ touchscreen-inverted-y;
+ vddio-supply = <®_ldo_io1>;
+ status = "okay";
+};
--
2.9.3
^ permalink raw reply related
* [PATCH 2/5] ARM: dts: sun8i: Add touchscreen node for sun8i-a23-inet86dz
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911182327.824-1-hdegoede@redhat.com>
The inet86dz tablet has a gsl1680 touchscreen,
add a dt node describing it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/boot/dts/sun8i-a23-inet86dz.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a23-inet86dz.dts b/arch/arm/boot/dts/sun8i-a23-inet86dz.dts
index 0f9f71b..d440575 100644
--- a/arch/arm/boot/dts/sun8i-a23-inet86dz.dts
+++ b/arch/arm/boot/dts/sun8i-a23-inet86dz.dts
@@ -53,6 +53,15 @@
status = "okay";
};
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl1680";
+ firmware-name = "gsl1680-inet86dz.fw";
+ touchscreen-size-x = <960>;
+ touchscreen-size-y = <640>;
+ status = "okay";
+};
+
&usbphy {
usb1_vbus-supply = <®_dldo1>;
};
--
2.9.3
^ permalink raw reply related
* [PATCH 1/5] ARM: dts: sun8i: Add touchscreen node for sun8i-a23-gt90h
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911182327.824-1-hdegoede@redhat.com>
The gt90h tablet has a gsl3675 touchscreen, add a dt node describing it.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts b/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts
index f27ebbb..e3c7a25 100644
--- a/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts
+++ b/arch/arm/boot/dts/sun8i-a23-gt90h-v4.dts
@@ -53,6 +53,15 @@
status = "okay";
};
+&touchscreen {
+ reg = <0x40>;
+ compatible = "silead,gsl3675";
+ firmware-name = "gsl3675-gt90h.fw";
+ touchscreen-size-x = <1792>;
+ touchscreen-size-y = <1024>;
+ status = "okay";
+};
+
&lradc {
button at 600 {
label = "Back";
--
2.9.3
^ permalink raw reply related
* [PATCH 0/5] ARM: dts: sun8i: Add touchscreen node to various tablets
From: Hans de Goede @ 2016-09-11 18:23 UTC (permalink / raw)
To: linux-arm-kernel
Hi Maxime,
Now that Dmitry has queued up the firmware-name property changes
in his for-linus branch, these dt patches are ready for merging.
Regards,
Hans
^ permalink raw reply
* [PATCH] Revert "Input: bma150 - extend chip detection for bma180"
From: Hans de Goede @ 2016-09-11 16:43 UTC (permalink / raw)
To: linux-arm-kernel
This reverts commit ef3714fdbc8d ("Input: bma150 - extend chip
detection for bma180").
The bma180 is not compatible with the bma150 at all, it has 14 bits
resolution instead of 10, and it has quite different control registers.
Treating the bma180 as a bma150 wrt its data registers will just result
in throwing away the lowest 4 bits, which is not too bad. But the ctrl
registers are a different story.
It may be that things happen to just work (I don't have a bma180 to
test with) but that certainly does not make this right.
Removing the bma180 id also removes overlap wrt the ids in the iio
bma180 driver which does treat the bma180 properly.
Cc: Dr. H. Nikolaus Schaller <hns@goldelico.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
---
drivers/input/misc/bma150.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index b0d4453..cae4832 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -70,7 +70,6 @@
#define BMA150_CFG_5_REG 0x11
#define BMA150_CHIP_ID 2
-#define BMA180_CHIP_ID 3
#define BMA150_CHIP_ID_REG BMA150_DATA_0_REG
#define BMA150_ACC_X_LSB_REG BMA150_DATA_2_REG
@@ -539,7 +538,7 @@ static int bma150_probe(struct i2c_client *client,
}
chip_id = i2c_smbus_read_byte_data(client, BMA150_CHIP_ID_REG);
- if (chip_id != BMA150_CHIP_ID && chip_id != BMA180_CHIP_ID) {
+ if (chip_id != BMA150_CHIP_ID) {
dev_err(&client->dev, "BMA150 chip id error: %d\n", chip_id);
return -EINVAL;
}
@@ -643,7 +642,6 @@ static UNIVERSAL_DEV_PM_OPS(bma150_pm, bma150_suspend, bma150_resume, NULL);
static const struct i2c_device_id bma150_id[] = {
{ "bma150", 0 },
- { "bma180", 0 },
{ "smb380", 0 },
{ "bma023", 0 },
{ }
--
2.9.3
^ permalink raw reply related
* [PATCH] arm64: mm: move zero page from .bss to right before swapper_pg_dir
From: Ard Biesheuvel @ 2016-09-11 16:40 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1473604714-5512-1-git-send-email-ard.biesheuvel@linaro.org>
On 11 September 2016 at 15:38, Ard Biesheuvel <ard.biesheuvel@linaro.org> wrote:
> Move the statically allocated zero page from the .bss section to right
> before swapper_pg_dir. This allows us to refer to its physical address
> by simply reading TTBR1_EL1 (which always points to swapper_pg_dir and
> always has its ASID field cleared), and subtracting PAGE_SIZE.
>
> Inspired-by: http://marc.info/?l=linux-arm-kernel&m=147282867511801
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> ---
> arch/arm64/include/asm/mmu_context.h | 10 ++++++----
> arch/arm64/kernel/head.S | 1 -
> arch/arm64/kernel/vmlinux.lds.S | 2 ++
> arch/arm64/mm/mmu.c | 1 -
> 4 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
> index b1892a0dbcb0..94461ba5febd 100644
> --- a/arch/arm64/include/asm/mmu_context.h
> +++ b/arch/arm64/include/asm/mmu_context.h
> @@ -49,13 +49,15 @@ static inline void contextidr_thread_switch(struct task_struct *next)
> */
> static inline void cpu_set_reserved_ttbr0(void)
> {
> - unsigned long ttbr = virt_to_phys(empty_zero_page);
> + unsigned long dummy;
>
> - asm(
> + asm volatile(
> + " mrs %0, ttbr1_el1 // get TTBR1\n"
> + " sub %0, %0, %1 // subtract PAGE_SIZE\n"
> " msr ttbr0_el1, %0 // set TTBR0\n"
> " isb"
> - :
> - : "r" (ttbr));
> + : "=&r" (dummy)
> + : "I" (PAGE_SIZE));
> }
>
> /*
This first hunk is wrong, given that cpu_set_reserved_ttbr0() may be
called when ttbr1_el1 does not point to swapper_pg_dir. But we should
be able to simply drop it without affecting the remainder of the
patch.
> diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
> index 8bc9458f9add..6020b884b076 100644
> --- a/arch/arm64/kernel/head.S
> +++ b/arch/arm64/kernel/head.S
> @@ -449,7 +449,6 @@ __primary_switched:
> adr_l x2, __bss_stop
> sub x2, x2, x0
> bl __pi_memset
> - dsb ishst // Make zero page visible to PTW
>
> #ifdef CONFIG_KASAN
> bl kasan_early_init
> diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
> index 659963d40bb4..a14eb8ff5144 100644
> --- a/arch/arm64/kernel/vmlinux.lds.S
> +++ b/arch/arm64/kernel/vmlinux.lds.S
> @@ -193,6 +193,8 @@ SECTIONS
> . = ALIGN(PAGE_SIZE);
> idmap_pg_dir = .;
> . += IDMAP_DIR_SIZE;
> + empty_zero_page = .;
> + . += PAGE_SIZE;
> swapper_pg_dir = .;
> . += SWAPPER_DIR_SIZE;
>
> diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
> index 4989948d1feb..539ce9d11325 100644
> --- a/arch/arm64/mm/mmu.c
> +++ b/arch/arm64/mm/mmu.c
> @@ -53,7 +53,6 @@ EXPORT_SYMBOL(kimage_voffset);
> * Empty_zero_page is a special page that is used for zero-initialized data
> * and COW.
> */
> -unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
> EXPORT_SYMBOL(empty_zero_page);
>
> static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss;
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH] arm64: mm: move zero page from .bss to right before swapper_pg_dir
From: Ard Biesheuvel @ 2016-09-11 14:38 UTC (permalink / raw)
To: linux-arm-kernel
Move the statically allocated zero page from the .bss section to right
before swapper_pg_dir. This allows us to refer to its physical address
by simply reading TTBR1_EL1 (which always points to swapper_pg_dir and
always has its ASID field cleared), and subtracting PAGE_SIZE.
Inspired-by: http://marc.info/?l=linux-arm-kernel&m=147282867511801
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
---
arch/arm64/include/asm/mmu_context.h | 10 ++++++----
arch/arm64/kernel/head.S | 1 -
arch/arm64/kernel/vmlinux.lds.S | 2 ++
arch/arm64/mm/mmu.c | 1 -
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/arch/arm64/include/asm/mmu_context.h b/arch/arm64/include/asm/mmu_context.h
index b1892a0dbcb0..94461ba5febd 100644
--- a/arch/arm64/include/asm/mmu_context.h
+++ b/arch/arm64/include/asm/mmu_context.h
@@ -49,13 +49,15 @@ static inline void contextidr_thread_switch(struct task_struct *next)
*/
static inline void cpu_set_reserved_ttbr0(void)
{
- unsigned long ttbr = virt_to_phys(empty_zero_page);
+ unsigned long dummy;
- asm(
+ asm volatile(
+ " mrs %0, ttbr1_el1 // get TTBR1\n"
+ " sub %0, %0, %1 // subtract PAGE_SIZE\n"
" msr ttbr0_el1, %0 // set TTBR0\n"
" isb"
- :
- : "r" (ttbr));
+ : "=&r" (dummy)
+ : "I" (PAGE_SIZE));
}
/*
diff --git a/arch/arm64/kernel/head.S b/arch/arm64/kernel/head.S
index 8bc9458f9add..6020b884b076 100644
--- a/arch/arm64/kernel/head.S
+++ b/arch/arm64/kernel/head.S
@@ -449,7 +449,6 @@ __primary_switched:
adr_l x2, __bss_stop
sub x2, x2, x0
bl __pi_memset
- dsb ishst // Make zero page visible to PTW
#ifdef CONFIG_KASAN
bl kasan_early_init
diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
index 659963d40bb4..a14eb8ff5144 100644
--- a/arch/arm64/kernel/vmlinux.lds.S
+++ b/arch/arm64/kernel/vmlinux.lds.S
@@ -193,6 +193,8 @@ SECTIONS
. = ALIGN(PAGE_SIZE);
idmap_pg_dir = .;
. += IDMAP_DIR_SIZE;
+ empty_zero_page = .;
+ . += PAGE_SIZE;
swapper_pg_dir = .;
. += SWAPPER_DIR_SIZE;
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 4989948d1feb..539ce9d11325 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -53,7 +53,6 @@ EXPORT_SYMBOL(kimage_voffset);
* Empty_zero_page is a special page that is used for zero-initialized data
* and COW.
*/
-unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)] __page_aligned_bss;
EXPORT_SYMBOL(empty_zero_page);
static pte_t bm_pte[PTRS_PER_PTE] __page_aligned_bss;
--
2.7.4
^ permalink raw reply related
* [kernel-hardening] Re: [PATCH v2 3/7] arm64: Introduce uaccess_{disable, enable} functionality based on TTBR0_EL1
From: Ard Biesheuvel @ 2016-09-11 13:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160906104514.GC1425@leverpostej>
On 6 September 2016 at 11:45, Mark Rutland <mark.rutland@arm.com> wrote:
> On Tue, Sep 06, 2016 at 11:27:42AM +0100, Catalin Marinas wrote:
>> On Mon, Sep 05, 2016 at 06:20:38PM +0100, Mark Rutland wrote:
>> > On Fri, Sep 02, 2016 at 04:02:09PM +0100, Catalin Marinas wrote:
>> > > +static inline void uaccess_ttbr0_enable(void)
>> > > +{
>> > > + unsigned long flags;
>> > > +
>> > > + /*
>> > > + * Disable interrupts to avoid preemption and potential saved
>> > > + * TTBR0_EL1 updates between reading the variable and the MSR.
>> > > + */
>> > > + local_irq_save(flags);
>> > > + write_sysreg(current_thread_info()->ttbr0, ttbr0_el1);
>> > > + isb();
>> > > + local_irq_restore(flags);
>> > > +}
>> >
>> > I don't follow what problem this actually protects us against. In the
>> > case of preemption everything should be saved+restored transparently, or
>> > things would go wrong as soon as we enable IRQs anyway.
>> >
>> > Is this a hold-over from a percpu approach rather than the
>> > current_thread_info() approach?
>>
>> If we get preempted between reading current_thread_info()->ttbr0 and
>> writing TTBR0_EL1, a series of context switches could lead to the update
>> of the ASID part of ttbr0. The actual MSR would store an old ASID in
>> TTBR0_EL1.
>
> Ah! Can you fold something about racing with an ASID update into the
> description?
>
>> > > +#else
>> > > +static inline void uaccess_ttbr0_disable(void)
>> > > +{
>> > > +}
>> > > +
>> > > +static inline void uaccess_ttbr0_enable(void)
>> > > +{
>> > > +}
>> > > +#endif
>> >
>> > I think that it's better to drop the ifdef and add:
>> >
>> > if (!IS_ENABLED(CONFIG_ARM64_TTBR0_PAN))
>> > return;
>> >
>> > ... at the start of each function. GCC should optimize the entire thing
>> > away when not used, but we'll get compiler coverage regardless, and
>> > therefore less breakage. All the symbols we required should exist
>> > regardless.
>>
>> The reason for this is that thread_info.ttbr0 is conditionally defined.
>> I don't think the compiler would ignore it.
>
> Good point; I missed that.
>
> [...]
>
>> > How about something like:
>> >
>> > .macro alternative_endif_else_nop
>> > alternative_else
>> > .rept ((662b-661b) / 4)
>> > nop
>> > .endr
>> > alternative_endif
>> > .endm
>> >
>> > So for the above we could have:
>> >
>> > alternative_if_not ARM64_HAS_PAN
>> > save_and_disable_irq \tmp2
>> > uaccess_ttbr0_enable \tmp1
>> > restore_irq \tmp2
>> > alternative_endif_else_nop
>> >
>> > I'll see about spinning a patch, or discovering why that happens to be
>> > broken.
>>
>> This looks better. Minor comment, I would actually name the ending
>> statement alternative_else_nop_endif to match the order in which you'd
>> normally write them.
>
> Completely agreed. I already made this change locally, immediately after
> sending the suggestion. :)
>
>> > > * tables again to remove any speculatively loaded cache lines.
>> > > */
>> > > mov x0, x25
>> > > - add x1, x26, #SWAPPER_DIR_SIZE
>> > > + add x1, x26, #SWAPPER_DIR_SIZE + RESERVED_TTBR0_SIZE
>> > > dmb sy
>> > > bl __inval_cache_range
>> > >
>> > > diff --git a/arch/arm64/kernel/vmlinux.lds.S b/arch/arm64/kernel/vmlinux.lds.S
>> > > index 659963d40bb4..fe393ccf9352 100644
>> > > --- a/arch/arm64/kernel/vmlinux.lds.S
>> > > +++ b/arch/arm64/kernel/vmlinux.lds.S
>> > > @@ -196,6 +196,11 @@ SECTIONS
>> > > swapper_pg_dir = .;
>> > > . += SWAPPER_DIR_SIZE;
>> > >
>> > > +#ifdef CONFIG_ARM64_TTBR0_PAN
>> > > + reserved_ttbr0 = .;
>> > > + . += PAGE_SIZE;
>> > > +#endif
>> >
>> > Surely RESERVED_TTBR0_SIZE, as elsewhere?
>>
>> I'll try to move it somewhere where it can be included in vmlinux.lds.S
>> (I can probably include cpufeature.h directly).
>
Do we really need another zero page? The ordinary zero page is already
statically allocated these days, so we could simply move it between
idmap_pg_dir[] and swapper_pg_dir[], and get all the changes in the
early boot code for free (given that it covers the range between the
start of idmap_pg_dir[] and the end of swapper_pg_dir[])
That way, we could refer to __pa(empty_zero_page) anywhere by reading
ttbr1_el1 and subtracting PAGE_SIZE
^ permalink raw reply
* [PATCH 4/7] phy: meson: add USB2 PHY support for Meson8b and GXBB
From: Martin Blumenstingl @ 2016-09-11 13:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAFBinCDohOoFP_3GC+=tt6S7sPS308ao-yf+oGhdfwo-N-JnAA@mail.gmail.com>
On Fri, Sep 9, 2016 at 10:36 PM, Martin Blumenstingl
<martin.blumenstingl@googlemail.com> wrote:
> On Fri, Sep 9, 2016 at 5:33 PM, Kevin Hilman <khilman@baylibre.com> wrote:
>> Martin Blumenstingl <martin.blumenstingl@googlemail.com> writes:
>>
>>> On Thu, Sep 8, 2016 at 10:53 PM, Ben Dooks <ben.dooks@codethink.co.uk> wrote:
>>>> On 08/09/16 21:42, Kevin Hilman wrote:
>>>>>
>>>>> Ben Dooks <ben.dooks@codethink.co.uk> writes:
>>>>>
>>>>>> On 08/09/16 20:52, Martin Blumenstingl wrote:
>>>>>>>
>>>>>>> On Thu, Sep 8, 2016 at 9:35 PM, Kevin Hilman <khilman@baylibre.com>
>>>>>>> wrote:
>>>>>>>>>
>>>>>>>>> + phy = devm_phy_create(&pdev->dev, NULL, &phy_meson_usb2_ops);
>>>>>>>>> + if (IS_ERR(phy)) {
>>>>>>>>> + dev_err(&pdev->dev, "failed to create PHY\n");
>>>>>>>>> + return PTR_ERR(phy);
>>>>>>>>> + }
>>>>>>>>> +
>>>>>>>>> + if (usb_reset_refcnt++ == 0) {
>>>>>>>>> + ret = device_reset(&pdev->dev);
>>>>>>>>> + if (ret) {
>>>>>>>>> + dev_err(&phy->dev, "Failed to reset USB PHY\n");
>>>>>>>>> + return ret;
>>>>>>>>> + }
>>>>>>>>> + }
>>>>>>>>
>>>>>>>>
>>>>>>>> The ref count + reset here looks like something that could/should be
>>>>>>>> handled in a runtime PM callback.
>>>>>>>
>>>>>>> Unfortunately that doesn't work (as Jerome found out) because both
>>>>>>> PHYs are sharing the same reset line.
>>>>>>> So if the second PHY would call device_reset then it would also reset
>>>>>>> the first PHY!
>>>>>>>
>>>>>>> There's a comment above the declaration of usb_reset_refcnt which
>>>>>>> tries to explain this:
>>>>>>> "The PHYs are sharing a common reset line -> we are only allowed to
>>>>>>> reset once for all PHYs."
>>>>>>> Maybe I should move this comment to the "if (usb_reset_refcnt++ == 0)
>>>>>>> {" line to make it easier to see?
>>>>>>>
>>>>>>
>>>>>> pm-runtime has refcounting in it. When one of the nodes turns on,
>>>>>> the pm-runtime will call your driver to say there is a user when
>>>>>> this first use turns up.
>>>>>>
>>>>>> If all the sub-phys turn off and drop their refcount then the driver
>>>>>> is called to say there are no more users and you can go to sleep.
>>>>>
>>>>>
>>>>> After a chat w/Martin on IRC, It turns out runtime PM wont help here.
>>>>>
>>>>> The reason is because there are physically two PHY devices[1]. Those 2
>>>>> devices will be treated independely by runtime PM, and have separate
>>>>> use-counting, which means doing what I proposed would cause a reset to
>>>>> happen when either device was probed.
>>>>>
>>>>> So, I think it's OK as it is.
>>>>
>>>>
>>>> Surely you can do pm_runtime_get/put on the phy's parent platform
>>>> device and do it that way?
>>> could you please be more specific with that (do you mean pdev->dev.parent)?
>>> so we would use pm_runtime_{get_sync,put} with the parent, while we
>>> would still define the runtime_resume in our driver.
>>
>> You'd also need to do get/put on the children, but yes, that's what Ben
>> is suggesting.
>>
>> However, the problem with all of the solutions proposed (runtime PM ones
>> included) is that we're forcing a board-specific design issue (2 devices
>> sharing a reset line) into a driver that should not have any
>> board-specific assumptions in it.
>>
>> For example, if this driver is used on another platform where different
>> PHYs have different reset lines, then one of them (the unlucky one who
>> is not probed first) will never get reset. So any form of per-device
>> ref-counting is not a portable solution.
> indeed, so in simple words we would need something like
> reset_control_do_once(rstc, RESET/ASSERT/DEASSERT) which would
> remember internally if any action has already been executed: if not it
> does a _reset, _assert or _deassert and otherwise it does nothing.
for now I've implemented something less hacky: I made the reset
optional and only specified it for phy0.
During Jerome's tests the reset was not needed, while on my board it's
required to bring both PHYs up.
Additionally the USB PHY reference driver does not have any reset
logic for newer SoCs (GXL), so making the reset optional doesn't sound
that bad to me.
^ permalink raw reply
* [PATCH v2 6/6] ARM64: meson-gxbb-vega-s95: Enable USB Nodes
From: Martin Blumenstingl @ 2016-09-11 13:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20160911134111.31141-1-martin.blumenstingl@googlemail.com>
Enable both gxbb USB controller and add a 5V regulator for the OTG port
VBUS
Signed-off-by: Martin Blumenstingl <martin.blumenstingl@googlemail.com>
Signed-off-by: Jerome Brunet <jbrunet@baylibre.com>
---
.../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi | 30 ++++++++++++++++++++++
1 file changed, 30 insertions(+)
diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
index 463185d..bad32e6 100644
--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
+++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
@@ -77,6 +77,19 @@
compatible = "mmc-pwrseq-emmc";
reset-gpios = <&gpio BOOT_9 GPIO_ACTIVE_LOW>;
};
+
+ usb_vbus: regulator-usb0-vbus {
+ compatible = "regulator-fixed";
+
+ regulator-name = "USB0_VBUS";
+
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+
+ gpio = <&gpio GPIODV_24 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+
};
&uart_AO {
@@ -133,3 +146,20 @@
vmmc-supply = <&vcc_3v3>;
vmmcq-sumpply = <&vcc_1v8>;
};
+
+&usb0_phy {
+ status = "okay";
+ phy-supply = <&usb_vbus>;
+};
+
+&usb1_phy {
+ status = "okay";
+};
+
+&usb0 {
+ status = "okay";
+};
+
+&usb1 {
+ status = "okay";
+};
--
2.9.3
^ permalink raw reply related
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