Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: PATCH] video: fix up versatile CLCD helper move
From: Linus Walleij @ 2014-07-22 12:49 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <9561883.zqovrcBa4A@wuerfel>

On Tue, Jul 15, 2014 at 10:39 AM, Arnd Bergmann <arnd@arndb.de> wrote:

> commit 11c32d7b6274cb0f ("video: move Versatile CLCD helpers")
> moved files out of the plat-versatile directory but in the process
> got a few of the dependencies wrong:
>
> - If CONFIG_FB is not set, the file no longer gets built, resulting
>   in a link error
> - If CONFIG_FB or CONFIG_FB_ARMCLCD are disabled, we also get a
>   Kconfig warning for incorrect dependencies due to the symbol
>   being 'select'ed from the platform Kconfig.
> - When the file is not built, we also get a link error for missing
>   symbols.
>
> This patch should fix all three, by removing the 'select' statements,
> changing the Kconfig description of the symbol to be enabled in
> exactly the right configurations, and adding inline stub functions
> for the case when the framebuffer driver is disabled.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Excellent, thanks a lot Arnd! I struggled with this but didn't
get it right after all :-/
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Linus Walleij @ 2014-07-22 15:08 UTC (permalink / raw)
  To: abdoulaye berthe, arm@kernel.org, Ralf Baechle,
	Benjamin Herrenschmidt, Rafał Miłecki, Jiri Kosina,
	Dmitry Torokhov, Bryan Wu, Mauro Carvalho Chehab, Lee Jones,
	Samuel Ortiz, Matthew Garrett, Michael Buesch, Greg KH,
	Tomi Valkeinen, Mark Brown, Liam Girdwood
  Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips,
	linux-sh@vger.kernel.org, Linux Input,
	linux-media@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org
In-Reply-To: <1405197014-25225-4-git-send-email-berthe.ab@gmail.com>

On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:

Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
applied. We're getting rid of the return value from gpiochip_remove().

> this remove all reference to gpio_remove retval in all driver
> except pinctrl and gpio. the same thing is done for gpio and
> pinctrl in two different patches.
>
> Signed-off-by: abdoulaye berthe <berthe.ab@gmail.com>
(...)

I think this patch probably needs to be broken down per-subsystem as it
hits all over the map. But let's start requesting ACKs for the
individual pieces.
Actually I think it will be OK to merge because there is likely not much churn
around these code sites.

I'm a bit torn between just wanting a big patch for this hitting drivers/gpio
and smaller patches hitting one subsystem at a time. We should be able
to hammer this in one switch strike.

>  arch/arm/common/scoop.c                        | 10 ++--------

ARM SoC folks, can you ACK this?

>  arch/mips/txx9/generic/setup.c                 |  4 ++--

Ralf can you ACK this?

>  arch/powerpc/platforms/83xx/mcu_mpc8349emitx.c |  3 ++-

Benji, can you ACK this?

>  arch/sh/boards/mach-x3proto/gpio.c             |  6 ++----

Aha noone can ACK this, whatever...

>  drivers/bcma/driver_gpio.c                     |  3 ++-

Rafał can you ACK this?

>  drivers/hid/hid-cp2112.c                       |  6 ++----

Jiri can you ACK this?

>  drivers/input/keyboard/adp5588-keys.c          |  4 +---
>  drivers/input/keyboard/adp5589-keys.c          |  4 +---
>  drivers/input/touchscreen/ad7879.c             | 10 +++-------

Dmitry can you ACK this?

>  drivers/leds/leds-pca9532.c                    | 10 ++--------
>  drivers/leds/leds-tca6507.c                    |  7 ++-----

Bryan can you ACK this?

>  drivers/media/dvb-frontends/cxd2820r_core.c    | 10 +++-------

Mauro can you ACK this?

(Hm that looks weird. Mental note to look closer at this.)

>  drivers/mfd/asic3.c                            |  3 ++-
>  drivers/mfd/htc-i2cpld.c                       |  8 +-------
>  drivers/mfd/sm501.c                            | 17 +++--------------
>  drivers/mfd/tc6393xb.c                         | 13 ++++---------
>  drivers/mfd/ucb1x00-core.c                     |  8 ++------

Lee/Sam can either of you ACK this?

>  drivers/pinctrl/pinctrl-abx500.c               | 15 +++------------
>  drivers/pinctrl/pinctrl-exynos5440.c           |  6 +-----
>  drivers/pinctrl/pinctrl-msm.c                  | 10 +++-------
>  drivers/pinctrl/pinctrl-nomadik.c              |  2 +-
>  drivers/pinctrl/pinctrl-samsung.c              | 14 ++++----------

Abdoulaye: these should be in the other patch for pinctrl.

>  drivers/platform/x86/intel_pmic_gpio.c         |  3 +--

Matthew can you ACK this?

>  drivers/ssb/driver_gpio.c                      |  3 ++-

Michael can you (A) ACK this and
(B) think of moving this driver to drivers/gpio... Patches welcome.

>  drivers/staging/vme/devices/vme_pio2_gpio.c    |  4 +---
>  drivers/tty/serial/max310x.c                   | 10 ++++------

Greg can you ACK this?

>  drivers/video/fbdev/via/via-gpio.c             | 10 +++-------

Tomi can you ACK this?

>  sound/soc/codecs/wm5100.c                      |  5 +----
>  sound/soc/codecs/wm8903.c                      |  6 +-----
>  sound/soc/codecs/wm8962.c                      |  5 +----
>  sound/soc/codecs/wm8996.c                      |  6 +-----

Liam || Mark can you ACK this?

Yours,
Linus Walleij

^ permalink raw reply

* [RFC v6 0/2] backlight: add new tps611xx backlight driver
From: Daniel Jeong @ 2014-07-23  8:10 UTC (permalink / raw)
  To: Jingoo Han, Bryan Wu, Lee Jones, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Grant Likely, Rob Herring, Randy Dunlap
  Cc: Daniel Jeong, linux-kernel, linux-fbdev, devicetree, linux-doc,
	Daniel Jeong

This driver a general version for tps611xx backlgiht chips of TI.
It supports tps61158, tps61161, tps61163 and tps61165 backlight driver
based on EasyScale protocol.

Daniel Jeong (2):
  [RFC v6 1/2] backlight: add new tps611xx backlight driver
  [RFC v6 2/2] backlight: device tree: add new tps611xx backlight binding

 .../video/backlight/tps611xx-backlight.txt         |   26 ++
 drivers/video/backlight/Kconfig                    |    7 +
 drivers/video/backlight/Makefile                   |    1 +
 drivers/video/backlight/tps611xx_bl.c              |  479 ++++++++++++++++++++
 include/linux/platform_data/tps611xx_bl.h          |   31 ++
 5 files changed, 544 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/backlight/tps611xx-backlight.txt
 create mode 100644 drivers/video/backlight/tps611xx_bl.c
 create mode 100644 include/linux/platform_data/tps611xx_bl.h

-- 
1.7.9.5


^ permalink raw reply

* [RFC v6 1/2] backlight: add new tps611xx backlight driver
From: Daniel Jeong @ 2014-07-23  8:10 UTC (permalink / raw)
  To: Jingoo Han, Bryan Wu, Lee Jones, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Grant Likely, Rob Herring, Randy Dunlap
  Cc: Daniel Jeong, linux-kernel, linux-fbdev, devicetree, linux-doc,
	Daniel Jeong
In-Reply-To: <1406103053-12225-1-git-send-email-gshark.jeong@gmail.com>

This driver is a general version for tps611xx backlgiht chips of TI.
It supports tps61158, tps61161, tps61163 and tps61165 backlight driver
based on EasyScale protocol(1-Wire Control Interface).

EasyScale
EasyScale is a simple but flexible one pin interface to configure the current.
The interface is based on a master-slave structure, where the master is
typically a microcontroller or application processor and the IC is the slave.
The advantage of EasyScale compared with other one pin interfaces is that
its bit detection is in a large extent independent from the bit transmission
rate. It can automatically detect bit rates between 1.7kBit/sec and up
to 160kBit/sec.

EasyScale on TPS61163
A command consists of 24 bits, including an 8-bit device address byte and
a 16-bit data byte. All of the 24 bits should be transmitted together each
time, and the LSB bit should be transmitted first. The device address byte
A7(MSB)~A0(LSB) is fixed to 0x8F.
The data byte includes 9 bits D8(MSB)~D0(LSB) for brightness information
and an RFA bit. The RFA bit set to "1" indicates the Request for Acknowledge
condition. The Acknowledge condition is only applied when the protocol is
received correctly.
Bit sream : D0-D8 | 0 | RFA | 00000 | A0-A7
Please refer to the links below  for more details.
http://www.ti.com/lit/ds/symlink/tps61163.pdf

EasyScale on TPS61158/61/65
A command consists of 16 bits, including an 8-bit device address byte
and a 8-bit data byte. All of the 16 bits should be transmitted together
each time, and the MSB bit should be transmitted first. The device address
byte A7(MSB)~A0(LSB) is fixed (tps61158 0x58 tps61161 and tps61165 0x72).
The data byte includes an RFA bit.
The RFA bit set to "1" indicates the Request for Acknowledge condition.
The Acknowledge condition is only applied when the protocol is received
correctly.
Bit sream : A7-A0 | RFA | 00 | D4-D0
Please refer to the links below  for more details.
http://www.ti.com/lit/ds/symlink/tps61158.pdf
http://www.ti.com.cn/cn/lit/ds/symlink/tps61161-q1.pdf
http://www.ti.com/lit/ds/symlink/tps61165.pdf

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
---
[v6]
applied Varka's comments.
change the position of of_device_id []
delete owner
[v5]
dt document was changed
---
 drivers/video/backlight/Kconfig           |    7 +
 drivers/video/backlight/Makefile          |    1 +
 drivers/video/backlight/tps611xx_bl.c     |  479 +++++++++++++++++++++++++++++
 include/linux/platform_data/tps611xx_bl.h |   31 ++
 4 files changed, 518 insertions(+)
 create mode 100644 drivers/video/backlight/tps611xx_bl.c
 create mode 100644 include/linux/platform_data/tps611xx_bl.h

diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 5a3eb2e..c779a85 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -418,6 +418,13 @@ config BACKLIGHT_TPS65217
 	  If you have a Texas Instruments TPS65217 say Y to enable the
 	  backlight driver.
 
+config BACKLIGHT_TPS611xx
+	tristate "TPS611xx Backlight"
+	depends on BACKLIGHT_CLASS_DEVICE && GPIOLIB
+	help
+	  This supports TI TPS61158,TPS61161, TPS61163 and TPS61165
+	  backlight driver based on EasyScale Protocol.
+
 config BACKLIGHT_AS3711
 	tristate "AS3711 Backlight"
 	depends on BACKLIGHT_CLASS_DEVICE && MFD_AS3711
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index bb82002..5c39945 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -51,5 +51,6 @@ obj-$(CONFIG_BACKLIGHT_PCF50633)	+= pcf50633-backlight.o
 obj-$(CONFIG_BACKLIGHT_PWM)		+= pwm_bl.o
 obj-$(CONFIG_BACKLIGHT_SAHARA)		+= kb3886_bl.o
 obj-$(CONFIG_BACKLIGHT_TOSA)		+= tosa_bl.o
+obj-$(CONFIG_BACKLIGHT_TPS611xx)	+= tps611xx_bl.o
 obj-$(CONFIG_BACKLIGHT_TPS65217)	+= tps65217_bl.o
 obj-$(CONFIG_BACKLIGHT_WM831X)		+= wm831x_bl.o
diff --git a/drivers/video/backlight/tps611xx_bl.c b/drivers/video/backlight/tps611xx_bl.c
new file mode 100644
index 0000000..1e06637
--- /dev/null
+++ b/drivers/video/backlight/tps611xx_bl.c
@@ -0,0 +1,479 @@
+/*
+ * Simple driver for Texas Instruments TPS611XX Backlight driver chip
+ *        using EasyScale Interface. It supports TPS61158, TPS61161,
+ *        TPS61163 and TPS61165.
+ *
+ * Copyright (C) 2014 Texas Instruments
+ * Author: Daniel Jeong  <gshark.jeong@gmail.com>
+ *	       Ldd Mlp <ldd-mlp@list.ti.com>
+ *
+ * This program 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.
+ *
+ */
+
+#include <linux/backlight.h>
+#include <linux/delay.h>
+#include <linux/err.h>
+#include <linux/fb.h>
+#include <linux/gpio.h>
+#include <linux/init.h>
+#include <linux/kernel.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/of_gpio.h>
+#include <linux/of_device.h>
+#include <linux/platform_data/tps611xx_bl.h>
+#include <linux/platform_device.h>
+#include <linux/slab.h>
+
+#define CMD_FORWARD 0
+#define CMD_BACKWARD 1
+
+enum tps611xx_id {
+	TPS61158_ID = 0,
+	TPS61161_ID,
+	TPS61163_ID,
+	TPS61165_ID,
+};
+
+/*
+ * easyscale time spec
+ * @es_delay : es delay time(ns)
+ * @es_det   : es detection time(ns)
+ * @start    : start time of data stream(ns)
+ * @eos      : end time of data stream(ns)
+ * @reset    : ic shutdown time(ms)
+ * @logic_1_low : low time high bit(ns)
+ * @logic_0_low : low time low bit(ns)
+ * @ackn        : duation of ack condistion(ns)
+ * @ack_poll    : ack polling duration(ns)
+ */
+struct tps611xx_time {
+	unsigned int es_delay;
+	unsigned int es_det;
+	unsigned int start;
+	unsigned int eos;
+	unsigned int reset;
+	unsigned int logic_1_low;
+	unsigned int logic_0_low;
+	unsigned int ackn;
+	unsigned int ack_poll;
+};
+
+/*
+ * @seq : sequence of data transfer
+ * @size: size of data
+ * @brt_max : max brightness
+ * @brt_bmask : bit mask of dimming bits
+ * @rfa_bmask : bit mask of RFA(Request for Acknowledge condition)
+ */
+struct tps611xx_command {
+	int seq;
+	int size;
+	int brt_max;
+	int brt_bmask;
+	int rfa_bmask;
+};
+
+/*
+ * @id : product id
+ * @name : product name
+ * @addr : device address
+ * @cmd  : es command info
+ * @time : es time info
+ */
+struct tps611xx_esdata {
+	enum tps611xx_id id;
+	char *name;
+	int addr;
+	struct tps611xx_command cmd;
+	struct tps611xx_time time;
+};
+
+struct tps611xx_bl_data {
+	struct device *dev;
+	struct backlight_device *bled;
+	struct tps611xx_platform_data *pdata;
+
+	/*
+	 * @rfa_en : RFA enable (Request for Acknowledge condition)
+	 * @en_gpio: enable pin gpio no.
+	 * @esdata : easyscale data
+	 */
+	int rfa_en;
+	unsigned int en_gpio;
+	const struct tps611xx_esdata *esdata;
+};
+
+static struct tps611xx_esdata tps611xx_info[] = {
+	[TPS61158_ID] = {
+		.id = TPS61158_ID,
+		.name = "tps61158",
+		.addr = 0x5800,
+		.cmd = {
+			.seq = CMD_FORWARD,
+			.size = 16,
+			.brt_max = 31,
+			.brt_bmask = 0x1f,
+			.rfa_bmask = 0x80
+		},
+		.time = {
+			.es_delay = 100000,
+			.es_det = 450000,
+			.start = 3500,
+			.eos = 3500,
+			.reset = 4,
+			.logic_1_low = 5000,
+			.logic_0_low = 15000,
+			.ackn = 900000,
+			.ack_poll = 2000
+		},
+	},
+
+	[TPS61161_ID] = {
+		.id = TPS61161_ID,
+		.name = "tps61161",
+		.addr = 0x7200,
+		.cmd = {
+			.seq = CMD_FORWARD,
+			.size = 16,
+			.brt_max = 31,
+			.brt_bmask = 0x1f,
+			.rfa_bmask = 0x80
+		},
+		.time = {
+			.es_delay = 120000,
+			.es_det = 280000,
+			.start = 2000,
+			.eos = 2000,
+			.reset = 3,
+			.logic_1_low = 3000,
+			.logic_0_low = 7000,
+			.ackn = 512000,
+			.ack_poll = 2000
+		},
+	},
+
+	[TPS61163_ID] = {
+		.id = TPS61163_ID,
+		.name = "tps61163",
+		.addr = 0x8F0000,
+		.cmd = {
+			.seq = CMD_BACKWARD,
+			.size = 24,
+			.brt_max = 511,
+			.brt_bmask = 0x1ff,
+			.rfa_bmask = 0x400
+		},
+		.time = {
+			.es_delay = 100000,
+			.es_det = 260000,
+			.start = 2000,
+			.eos = 2000,
+			.reset = 3,
+			.logic_1_low = 3000,
+			.logic_0_low = 7000,
+			.ackn = 512000,
+			.ack_poll = 2000
+		},
+	},
+
+	[TPS61165_ID] = {
+		.id = TPS61165_ID,
+		.name = "tps61165",
+		.addr = 0x7200,
+		.cmd = {
+			.seq = CMD_FORWARD,
+			.size = 16,
+			.brt_max = 31,
+			.brt_bmask = 0x1f,
+			.rfa_bmask = 0x80
+		},
+		.time = {
+			.es_delay = 120000,
+			.es_det = 280000,
+			.start = 4000,
+			.eos = 4000,
+			.reset = 3,
+			.logic_1_low = 3000,
+			.logic_0_low = 7000,
+			.ackn = 512000,
+			.ack_poll = 2000
+		},
+	},
+};
+
+static int tps611xx_bl_update_status(struct backlight_device *bl)
+{
+	struct tps611xx_bl_data *pchip = bl_get_data(bl);
+	const struct tps611xx_esdata *esdata = pchip->esdata;
+	int data_in, t_low, t_logic, max_bmask;
+	unsigned long flags;
+
+	data_in = esdata->addr | (bl->props.brightness & esdata->cmd.brt_bmask);
+	if (pchip->rfa_en)
+		data_in |= esdata->cmd.rfa_bmask;
+
+	max_bmask = 0x1 << esdata->cmd.size;
+	t_logic = esdata->time.logic_1_low + esdata->time.logic_0_low;
+
+	local_irq_save(flags);
+	/* t_start : 2us high before data byte */
+	gpio_direction_output(pchip->en_gpio, 1);
+	ndelay(esdata->time.start);
+
+	/* forward command transfer */
+	if (esdata->cmd.seq = CMD_FORWARD) {
+		int addr_bmask = max_bmask >> 8;
+
+		for (max_bmask >>= 1; max_bmask > 0x0; max_bmask >>= 1) {
+			if (data_in & max_bmask)
+				t_low = esdata->time.logic_1_low;
+			else
+				t_low = esdata->time.logic_0_low;
+
+			gpio_direction_output(pchip->en_gpio, 0);
+			ndelay(t_low);
+			gpio_direction_output(pchip->en_gpio, 1);
+			ndelay(t_logic - t_low);
+
+			if (max_bmask = addr_bmask) {
+				gpio_direction_output(pchip->en_gpio, 0);
+				/* t_eos : low after address byte */
+				ndelay(esdata->time.eos);
+				gpio_direction_output(pchip->en_gpio, 1);
+				/* t_start : high before data byte */
+				ndelay(esdata->time.start);
+			}
+		}
+	} else {
+		/* backward command tansfer */
+		int bmask;
+
+		for (bmask = 0x01; bmask < max_bmask; bmask <<= 1) {
+			if (data_in & bmask)
+				t_low = esdata->time.logic_1_low;
+			else
+				t_low = esdata->time.logic_0_low;
+
+			gpio_direction_output(pchip->en_gpio, 0);
+			ndelay(t_low);
+			gpio_direction_output(pchip->en_gpio, 1);
+			ndelay(t_logic - t_low);
+		}
+	}
+
+	/*
+	 * t_eos : low after address byte
+	 * t_ackVal is also t_eos
+	 */
+	gpio_direction_output(pchip->en_gpio, 0);
+	ndelay(esdata->time.eos);
+
+	/* RFA management  */
+	if (pchip->rfa_en) {
+		int max_ack_time = esdata->time.ackn;
+		/* set input */
+		gpio_direction_input(pchip->en_gpio);
+		/* read acknowledge from chip */
+		while (max_ack_time > 0) {
+			if (gpio_get_value(pchip->en_gpio) = 0)
+				break;
+			max_ack_time -= esdata->time.ack_poll;
+		}
+		if (max_ack_time <= 0)
+			dev_err(pchip->dev,
+				"easyscale : no ack from %s\n", esdata->name);
+		else
+			ndelay(max_ack_time);
+	}
+	gpio_direction_output(pchip->en_gpio, 1);
+	local_irq_restore(flags);
+
+	return bl->props.brightness;
+}
+
+static const struct backlight_ops tps611xx_bl_ops = {
+	.update_status = tps611xx_bl_update_status,
+};
+
+static ssize_t tps611xx_enable_store(struct device *dev,
+				     struct device_attribute *devAttr,
+				     const char *buf, size_t size)
+{
+	struct tps611xx_bl_data *pchip = dev_get_drvdata(dev);
+	const struct tps611xx_esdata *esdata = pchip->esdata;
+	unsigned long flags;
+	unsigned int input;
+	int ret;
+
+	ret = kstrtouint(buf, 10, &input);
+	if (ret)
+		return -EINVAL;
+
+	local_irq_save(flags);
+	if (input = 0) {
+		/* chip disable */
+		gpio_direction_output(pchip->en_gpio, 0);
+		/* low more than reset ms to reset */
+		mdelay(esdata->time.reset);
+	} else {
+		/* easyscale detection window */
+		gpio_direction_output(pchip->en_gpio, 1);
+		ndelay(esdata->time.es_delay);
+		gpio_direction_output(pchip->en_gpio, 0);
+		ndelay(esdata->time.es_det);
+		gpio_direction_output(pchip->en_gpio, 1);
+	}
+	local_irq_restore(flags);
+
+	return size;
+}
+
+static DEVICE_ATTR(enable, S_IWUSR, NULL, tps611xx_enable_store);
+
+#ifdef CONFIG_OF
+static int tps611xx_backlight_parse_dt(struct tps611xx_bl_data *pchip)
+{
+	struct device *dev = pchip->dev;
+	struct device_node *node = dev->of_node;
+	const struct of_device_id *of_id +	    of_match_device(tps611xx_backlight_of_match, dev);
+
+	if (!node)
+		return -ENODEV;
+
+	if (!of_id || !of_id->data) {
+		dev_err(dev, "Failed to find tps611xx chip id\n");
+		return -EFAULT;
+	}
+	pchip->esdata = of_id->data;
+	pchip->rfa_en = of_property_read_bool(node, "rfa-enable");
+	pchip->en_gpio = of_get_named_gpio(node, "es-gpio", 0);
+
+	return 0;
+}
+#else
+static int tps611xx_backlight_parse_dt(struct tps611xx_bl_data *pchip)
+{
+	return -ENODEV;
+}
+#endif
+
+static int tps611xx_backlight_probe(struct platform_device *pdev)
+{
+	struct tps611xx_bl_data *pchip;
+	struct backlight_properties props;
+	const struct tps611xx_esdata *esdata;
+	struct tps611xx_platform_data *pdata = dev_get_platdata(&pdev->dev);
+	unsigned long flags;
+	int ret;
+
+	pchip = devm_kzalloc(&pdev->dev,
+			     sizeof(struct tps611xx_bl_data), GFP_KERNEL);
+	if (pchip = NULL)
+		return -ENOMEM;
+	pchip->dev = &pdev->dev;
+
+	if (pdata = NULL) {
+		ret = tps611xx_backlight_parse_dt(pchip);
+		if (ret < 0)
+			return ret;
+	} else {
+		pchip->rfa_en = pdata->rfa_en;
+		pchip->en_gpio = pdata->en_gpio_num;
+		pchip->esdata = (const struct tps611xx_esdata *)
+		    platform_get_device_id(pdev)->driver_data;
+	}
+	esdata = pchip->esdata;
+
+	memset(&props, 0, sizeof(struct backlight_properties));
+	props.brightness = esdata->cmd.brt_max;
+	props.max_brightness = esdata->cmd.brt_max;
+	props.type = BACKLIGHT_RAW;
+	pchip->bled +	    devm_backlight_device_register(pchip->dev, TPS611XX_NAME,
+					   pchip->dev, pchip,
+					   &tps611xx_bl_ops, &props);
+	if (IS_ERR(pchip->bled))
+		return PTR_ERR(pchip->bled);
+
+	/* for enable/disable */
+	ret = device_create_file(&(pchip->bled->dev), &dev_attr_enable);
+	if (ret < 0) {
+		dev_err(pchip->dev, "failed : add sysfs entries\n");
+		return ret;
+	}
+	platform_set_drvdata(pdev, pchip);
+
+	/* EasyScale init */
+	ret = gpio_request_one(pchip->en_gpio, GPIOF_OUT_INIT_HIGH, "tps611xx");
+	if (ret) {
+		device_remove_file(&(pchip->bled->dev), &dev_attr_enable);
+		dev_err(pchip->dev, "failed : get gpio %d\n", pchip->en_gpio);
+		return ret;
+	}
+
+	/*
+	 * ES Detection Window
+	 *   - ES detect delay
+	 *   - ES detect time
+	 */
+	local_irq_save(flags);
+	gpio_direction_output(pchip->en_gpio, 1);
+	ndelay(esdata->time.es_delay);
+	gpio_direction_output(pchip->en_gpio, 0);
+	ndelay(esdata->time.es_det);
+	gpio_direction_output(pchip->en_gpio, 1);
+	local_irq_restore(flags);
+	dev_info(pchip->dev,
+		 "%s EasyScale is initialized\n", pchip->esdata->name);
+	return 0;
+}
+
+static int tps611xx_backlight_remove(struct platform_device *pdev)
+{
+	struct tps611xx_bl_data *pchip = platform_get_drvdata(pdev);
+	const struct tps611xx_esdata *esdata = pchip->esdata;
+
+	device_remove_file(&(pchip->bled->dev), &dev_attr_enable);
+	gpio_direction_output(pchip->en_gpio, 0);
+	mdelay(esdata->time.reset);
+	return 0;
+}
+
+static const struct of_device_id tps611xx_backlight_of_match[] = {
+	{.compatible = "ti,tps61158", .data = &tps611xx_info[TPS61158_ID]},
+	{.compatible = "ti,tps61161", .data = &tps611xx_info[TPS61161_ID]},
+	{.compatible = "ti,tps61163", .data = &tps611xx_info[TPS61163_ID]},
+	{.compatible = "ti,tps61165", .data = &tps611xx_info[TPS61165_ID]},
+	{}
+};
+
+MODULE_DEVICE_TABLE(of, tps611xx_backlight_of_match);
+
+static const struct platform_device_id tps611xx_id_table[] = {
+	{TPS61158_NAME, (unsigned long)&tps611xx_info[TPS61158_ID]},
+	{TPS61161_NAME, (unsigned long)&tps611xx_info[TPS61161_ID]},
+	{TPS61163_NAME, (unsigned long)&tps611xx_info[TPS61163_ID]},
+	{TPS61165_NAME, (unsigned long)&tps611xx_info[TPS61165_ID]},
+	{}
+};
+
+static struct platform_driver tps611xx_backlight_driver = {
+	.driver = {
+		.name = TPS611XX_NAME,
+		.of_match_table = of_match_ptr(tps611xx_backlight_of_match),
+	},
+	.probe = tps611xx_backlight_probe,
+	.remove = tps611xx_backlight_remove,
+	.id_table = tps611xx_id_table,
+};
+
+module_platform_driver(tps611xx_backlight_driver);
+
+MODULE_DESCRIPTION("EasyScale based tps611xx Backlight Driver");
+MODULE_LICENSE("GPL v2");
+MODULE_ALIAS("platform:tps611xx_bl");
diff --git a/include/linux/platform_data/tps611xx_bl.h b/include/linux/platform_data/tps611xx_bl.h
new file mode 100644
index 0000000..f16b43b
--- /dev/null
+++ b/include/linux/platform_data/tps611xx_bl.h
@@ -0,0 +1,31 @@
+/*
+ * Simple driver for Texas Instruments TPS611xx Backlight driver chip
+ * Copyright (C) 2014 Texas Instruments
+ *
+ * This program 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.
+ *
+ */
+
+#ifndef __TPS611XX_H
+#define __TPS611XX_H
+
+#define TPS611XX_NAME "tps611xx"
+#define TPS61158_NAME "tps61158"
+#define TPS61161_NAME "tps61161"
+#define TPS61163_NAME "tps61163"
+#define TPS61165_NAME "tps61165"
+
+/*
+ * struct tps611xx platform data
+ * @rfa_en : request for acknowledge
+ * @en_gpio_num : gpio number for en_pin
+ */
+struct tps611xx_platform_data {
+
+	int rfa_en;
+	unsigned int en_gpio_num;
+};
+
+#endif /* __TPS611XX_H */
-- 
1.7.9.5


^ permalink raw reply related

* [RFC v6 2/2] backlight: device tree: add new tps611xx backlight binding
From: Daniel Jeong @ 2014-07-23  8:10 UTC (permalink / raw)
  To: Jingoo Han, Bryan Wu, Lee Jones, Jean-Christophe Plagniol-Villard,
	Tomi Valkeinen, Grant Likely, Rob Herring, Randy Dunlap
  Cc: Daniel Jeong, linux-kernel, linux-fbdev, devicetree, linux-doc,
	Daniel Jeong
In-Reply-To: <1406103053-12225-1-git-send-email-gshark.jeong@gmail.com>

This commit is about tps611xx device tree documentation.

Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
---
[v6]
Nothing changed from v5. Driver files were changed
---
 .../video/backlight/tps611xx-backlight.txt         |   26 ++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/backlight/tps611xx-backlight.txt

diff --git a/Documentation/devicetree/bindings/video/backlight/tps611xx-backlight.txt b/Documentation/devicetree/bindings/video/backlight/tps611xx-backlight.txt
new file mode 100644
index 0000000..905c61b
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/backlight/tps611xx-backlight.txt
@@ -0,0 +1,26 @@
+TPS611xx family of backlight driver based on EasyScale.
+
+EasyScale is a simple but flexible one pin interface to configure the current.
+
+Required properties:
+- compatible: should contain at least one of
+  "ti,tps61158"
+  "ti,tps61161"
+  "ti,tps61163"
+  "ti,tps61165"
+- es-gpio : GPIO for easy-scale communication.(see GPIO binding[0])
+
+Optional properties:
+- rfa-enable: enable request for acknowledge.
+  If RFA is enabled, the data byte includes the RFA bit and device will wait
+  and check acknowledge from device.
+
+[0]: Documentation/devicetree/bindings/gpio/gpio.txt
+
+Example:
+
+	backlight {
+		compatible = "ti,tps61163";
+		es-gpio = <&gpio 45 0>;
+		rfa-enable;
+	};
-- 
1.7.9.5


^ permalink raw reply related

* Re: [PATCH] video: fbdev: uvesafb.c: Cleaning up variable that is never used
From: Rickard Strandqvist @ 2014-07-23 20:37 UTC (permalink / raw)
  To: Pavel Machek
  Cc: Joe Perches, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	Sachin Kamat, Evgeniy Polyakov, Wang YanQing, Rickard Strandqvist,
	Jingoo Han, Linux Fbdev development list, David Fries,
	linux-kernel@vger.kernel.org
In-Reply-To: <20140722092757.GA8796@amd.pavel.ucw.cz>

Hi

There is a lot in what you say.
In the beginning I send in a remark to the maintainer. It happened
absolutely nothing.

When I send out a patch that code is not used, then this code will be
reviewed. Which is the main purpose!

However, agree that this was perhaps an unusually clear solution.
I submit such a patch now.

Kind regards
Rickard Strandqvist


2014-07-22 11:27 GMT+02:00 Pavel Machek <pavel@ucw.cz>:
> On Tue 2014-07-22 11:16:58, Rickard Strandqvist wrote:
>> Hi
>>
>> Sure, I agree. But as I thought that I would not change
>> currentfunctionality, I would increase the chance that the patches were
>> included. And it would of course also clarify this type of problem.
>
> I'm trying to say that getting rid of the variables without changing
> functionality might be wrong thing to do, for example in this case. It
> looks like error handing is missing by mistake, and you are removing
> traces saying that error handing is required here.
>
> Dunno. Perhaps don't push patches where solution is not obvious?
>
> Or push them but mark the place with fixme?
>
>                                                                         Pavel
>
> --
> (english) http://www.livejournal.com/~pavelmachek
> (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

^ permalink raw reply

* [PATCH v2] video: fbdev: uvesafb.c:  Added additional error checking
From: Rickard Strandqvist @ 2014-07-23 21:20 UTC (permalink / raw)
  To: Jean-Christophe Plagniol-Villard, Tomi Valkeinen
  Cc: Rickard Strandqvist, Wang YanQing, Jingoo Han, David Fries,
	Greg Kroah-Hartman, Joe Perches, linux-fbdev, linux-kernel

Variable was assigned a value that is never used.
Now the variable is used, and the function returns if a call to
uvesafb_exec() returns a error.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
---
 drivers/video/fbdev/uvesafb.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/video/fbdev/uvesafb.c b/drivers/video/fbdev/uvesafb.c
index 509d452..47c2d74 100644
--- a/drivers/video/fbdev/uvesafb.c
+++ b/drivers/video/fbdev/uvesafb.c
@@ -561,6 +561,8 @@ static int uvesafb_vbe_getpmi(struct uvesafb_ktask *task,
 	task->t.regs.eax = 0x4f0a;
 	task->t.regs.ebx = 0x0;
 	err = uvesafb_exec(task);
+	if (err)
+		return err;
 
 	if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
 		par->pmi_setpal = par->ypan = 0;
-- 
1.7.10.4


^ permalink raw reply related

* RE: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
From: Dexuan Cui @ 2014-07-24  1:54 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org, dan.carpenter@oracle.com,
	linux-kernel@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org, plagnioj@jcrosoft.com,
	tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org
  Cc: olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
	KY Srinivasan, Haiyang Zhang
In-Reply-To: <1404875063-27424-1-git-send-email-decui@microsoft.com>

Ping again -- any one has further comment for the v3 version?

It looks the framebuffer layer's Tomi and Jean-Christophe are out recently?
Recently I don't see mail from them since Jul 1 and Jul 8 in the lists.

Though the patch belongs to driver/video/fbdev/, it only changes hyper-v stuff
and only changes one file and the patch itself is straightforward IMO.

So, hi Greg and all, 
If you think the patch itself is OK, may I know if it's OK for the patch to go
into Greg's char-misc.git tree, as some other hyper-v patches did?

Please let me know what's the next step I should do. 
I appreciate your reply.

Thanks!

-- Dexuan

> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Dexuan Cui
> Sent: Wednesday, July 9, 2014 11:04 AM
> To: gregkh@linuxfoundation.org; dan.carpenter@oracle.com; linux-
> kernel@vger.kernel.org; driverdev-devel@linuxdriverproject.org;
> plagnioj@jcrosoft.com; tomi.valkeinen@ti.com; linux-fbdev@vger.kernel.org
> Cc: olaf@aepfle.de; apw@canonical.com; jasowang@redhat.com; KY
> Srinivasan; Haiyang Zhang
> Subject: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force
> on VM panic
> 
> Currently the VSC has no chance to notify the VSP of the dirty rectangle on
> VM
> panic because the notification work is done in a workqueue, and in panic()
> the
> kernel typically ends up in an infinite loop, and a typical kernel config has
> CONFIG_PREEMPT_VOLUNTARY=y and CONFIG_PREEMPT is not set, so a
> context switch
> can't happen in panic() and the workqueue won't have a chance to run. As a
> result, the VM Connection window can't refresh until it's closed and we
> re-connect to the VM.
> 
> We can register a handler on panic_notifier_list: the handler can notify
> the VSC and switch the framebuffer driver to a "synchronous mode",
> meaning
> the VSC flushes any future framebuffer change to the VSP immediately.
> 
> v2: removed the MS-TFS line in the commit message
> v3: remove some 'unlikely' markings
> 
> Signed-off-by: Dexuan Cui <decui@microsoft.com>
> Reviewed-by: Haiyang Zhang <haiyangz@microsoft.com>
> ---
>  drivers/video/fbdev/hyperv_fb.c | 58
> ++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 55 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/video/fbdev/hyperv_fb.c
> b/drivers/video/fbdev/hyperv_fb.c
> index e23392e..a7b98e1 100644
> --- a/drivers/video/fbdev/hyperv_fb.c
> +++ b/drivers/video/fbdev/hyperv_fb.c
> @@ -226,11 +226,16 @@ struct hvfb_par {
>  	u8 recv_buf[MAX_VMBUS_PKT_SIZE];
>  };
> 
> +static struct fb_info *hvfb_info;
> +
>  static uint screen_width = HVFB_WIDTH;
>  static uint screen_height = HVFB_HEIGHT;
>  static uint screen_depth;
>  static uint screen_fb_size;
> 
> +/* If true, the VSC notifies the VSP on every framebuffer change */
> +static bool synchronous_fb;
> +
>  /* Send message to Hyper-V host */
>  static inline int synthvid_send(struct hv_device *hdev,
>  				struct synthvid_msg *msg)
> @@ -532,6 +537,20 @@ static void hvfb_update_work(struct work_struct *w)
>  		schedule_delayed_work(&par->dwork,
> HVFB_UPDATE_DELAY);
>  }
> 
> +static int hvfb_on_panic(struct notifier_block *nb,
> +			unsigned long e, void *p)
> +{
> +	if (hvfb_info)
> +		synthvid_update(hvfb_info);
> +
> +	synchronous_fb = true;
> +
> +	return NOTIFY_DONE;
> +}
> +
> +static struct notifier_block hvfb_panic_nb = {
> +	.notifier_call = hvfb_on_panic,
> +};
> 
>  /* Framebuffer operation handlers */
> 
> @@ -582,14 +601,41 @@ static int hvfb_blank(int blank, struct fb_info *info)
>  	return 1;	/* get fb_blank to set the colormap to all black */
>  }
> 
> +static void hvfb_cfb_fillrect(struct fb_info *p,
> +				const struct fb_fillrect *rect)
> +{
> +	cfb_fillrect(p, rect);
> +
> +	if (synchronous_fb)
> +		synthvid_update(p);
> +}
> +
> +static void hvfb_cfb_copyarea(struct fb_info *p,
> +				const struct fb_copyarea *area)
> +{
> +	cfb_copyarea(p, area);
> +
> +	if (synchronous_fb)
> +		synthvid_update(p);
> +}
> +
> +static void hvfb_cfb_imageblit(struct fb_info *p,
> +				const struct fb_image *image)
> +{
> +	cfb_imageblit(p, image);
> +
> +	if (synchronous_fb)
> +		synthvid_update(p);
> +}
> +
>  static struct fb_ops hvfb_ops = {
>  	.owner = THIS_MODULE,
>  	.fb_check_var = hvfb_check_var,
>  	.fb_set_par = hvfb_set_par,
>  	.fb_setcolreg = hvfb_setcolreg,
> -	.fb_fillrect = cfb_fillrect,
> -	.fb_copyarea = cfb_copyarea,
> -	.fb_imageblit = cfb_imageblit,
> +	.fb_fillrect = hvfb_cfb_fillrect,
> +	.fb_copyarea = hvfb_cfb_copyarea,
> +	.fb_imageblit = hvfb_cfb_imageblit,
>  	.fb_blank = hvfb_blank,
>  };
> 
> @@ -801,6 +847,9 @@ static int hvfb_probe(struct hv_device *hdev,
> 
>  	par->fb_ready = true;
> 
> +	hvfb_info = info;
> +	atomic_notifier_chain_register(&panic_notifier_list,
> &hvfb_panic_nb);
> +
>  	return 0;
> 
>  error:
> @@ -820,6 +869,9 @@ static int hvfb_remove(struct hv_device *hdev)
>  	struct fb_info *info = hv_get_drvdata(hdev);
>  	struct hvfb_par *par = info->par;
> 
> +	atomic_notifier_chain_unregister(&panic_notifier_list,
> &hvfb_panic_nb);
> +	hvfb_info = NULL;
> +
>  	par->update = false;
>  	par->fb_ready = false;
> 
> --
> 1.9.1
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

^ permalink raw reply

* Re: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
From: gregkh @ 2014-07-24  3:53 UTC (permalink / raw)
  To: Dexuan Cui
  Cc: dan.carpenter@oracle.com, linux-kernel@vger.kernel.org,
	driverdev-devel@linuxdriverproject.org, plagnioj@jcrosoft.com,
	tomi.valkeinen@ti.com, linux-fbdev@vger.kernel.org,
	olaf@aepfle.de, apw@canonical.com, jasowang@redhat.com,
	KY Srinivasan, Haiyang Zhang
In-Reply-To: <EE124450C0AAF944A40DD71E61F878C98D83A8@SINEX14MBXC417.southpacific.corp.microsoft.com>

On Thu, Jul 24, 2014 at 01:54:58AM +0000, Dexuan Cui wrote:
> Ping again -- any one has further comment for the v3 version?
> 
> It looks the framebuffer layer's Tomi and Jean-Christophe are out recently?
> Recently I don't see mail from them since Jul 1 and Jul 8 in the lists.
> 
> Though the patch belongs to driver/video/fbdev/, it only changes hyper-v stuff
> and only changes one file and the patch itself is straightforward IMO.
> 
> So, hi Greg and all, 
> If you think the patch itself is OK, may I know if it's OK for the patch to go
> into Greg's char-misc.git tree, as some other hyper-v patches did?

No, it needs to go through the fb tree, not mine, sorry.

greg k-h

^ permalink raw reply

* Re: [PATCH v2] video: fbdev: uvesafb.c:  Added additional error checking
From: Wang YanQing @ 2014-07-24 17:31 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
	David Fries, Greg Kroah-Hartman, Joe Perches, linux-fbdev,
	linux-kernel
In-Reply-To: <1406150427-26077-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
> Variable was assigned a value that is never used.
> Now the variable is used, and the function returns if a call to
> uvesafb_exec() returns a error.

Because the only user of uvesafb_vbe_getpmi in uvesafb.c
don't check its return value, it should do the check indeed,
so maybe below change is better:

-       if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+       if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
                par->pmi_setpal = par->ypan = 0;
        }

Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:

if (uvesafb_vbe_getpmi(task, par))
    par->pmi_setpal = par->ypan = 0;


Thanks.

^ permalink raw reply

* Re: [PATCH v2] video: fbdev: uvesafb.c:  Added additional error checking
From: Wang YanQing @ 2014-07-24 17:36 UTC (permalink / raw)
  To: Rickard Strandqvist
  Cc: Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
	David Fries, Greg Kroah-Hartman, Joe Perches, linux-fbdev,
	linux-kernel, pavel
In-Reply-To: <1406150427-26077-1-git-send-email-rickard_strandqvist@spectrumdigital.se>

On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
> Variable was assigned a value that is never used.
> Now the variable is used, and the function returns if a call to
> uvesafb_exec() returns a error.

Because the only user of uvesafb_vbe_getpmi in uvesafb.c
don't check its return value, it should do the check indeed,
so maybe below change is better:

-       if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
+       if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
                par->pmi_setpal = par->ypan = 0;
        }

Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:

if (uvesafb_vbe_getpmi(task, par))
    par->pmi_setpal = par->ypan = 0;


Add cc:pavel@ucw.cz, you should cc all the people who replied your patch 
in later patch version.

Thanks.

^ permalink raw reply

* RE: [PATCH v3] video: hyperv: hyperv_fb: refresh the VM screen by force on VM panic
From: Dexuan Cui @ 2014-07-25  7:15 UTC (permalink / raw)
  To: gregkh@linuxfoundation.org
  Cc: linux-fbdev@vger.kernel.org, jasowang@redhat.com,
	driverdev-devel@linuxdriverproject.org,
	linux-kernel@vger.kernel.org, tomi.valkeinen@ti.com,
	olaf@aepfle.de, apw@canonical.com, plagnioj@jcrosoft.com,
	Haiyang Zhang, dan.carpenter@oracle.com
In-Reply-To: <20140724035328.GB7484@kroah.com>

> -----Original Message-----
> From: gregkh@linuxfoundation.org [mailto:gregkh@linuxfoundation.org]
> Sent: Thursday, July 24, 2014 11:53 AM
> > So, hi Greg and all,
> > If you think the patch itself is OK, may I know if it's OK for the patch to go
> > into Greg's char-misc.git tree, as some other hyper-v patches did?
> 
> No, it needs to go through the fb tree, not mine, sorry.
> 
> greg k-h

Hi Greg,
Thank you very much for the clarification!
It's clear to me now.
Let me just wait the framebuffer maintainers' reply. :-)

Thanks,
-- Dexuan

^ permalink raw reply

* [PATCH] pwm-backlight: fix probing from device-tree without enable-gpios
From: Michael Olbrich @ 2014-07-25 10:28 UTC (permalink / raw)
  To: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot
  Cc: linux-pwm, linux-fbdev, linux-kernel, kernel, Michael Olbrich

Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
enable_gpio is no longer set and remains 0 when probing from
device-tree. This is a valid gpio number. With no enable-gpios
specified in the device-tree this is used and probing fails
with:

pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16

Fix this by setting enable_gpio to -1 which is not a valid gpio
number.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 drivers/video/backlight/pwm_bl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88b..5213d13 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "failed to find platform data\n");
 			return ret;
 		}
+		devdata.enable_gpio = -1;
 
 		data = &defdata;
 	}
-- 
2.0.1


^ permalink raw reply related

* [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios
From: Michael Olbrich @ 2014-07-25 11:47 UTC (permalink / raw)
  To: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot
  Cc: linux-pwm, linux-fbdev, linux-kernel, kernel, Michael Olbrich
In-Reply-To: <1406284115-489-1-git-send-email-m.olbrich@pengutronix.de>

Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
enable_gpio is no longer set and remains 0 when probing from
device-tree. This is a valid gpio number. With no enable-gpios
specified in the device-tree this is used and probing fails
with:

pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16

Fix this by setting enable_gpio to -1 which is not a valid gpio
number.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---

Sorry, I sent the wrong version. This one actually compiles.

Michael

 drivers/video/backlight/pwm_bl.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
index 38ca88b..e7e43cd 100644
--- a/drivers/video/backlight/pwm_bl.c
+++ b/drivers/video/backlight/pwm_bl.c
@@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
 			dev_err(&pdev->dev, "failed to find platform data\n");
 			return ret;
 		}
+		defdata.enable_gpio = -1;
 
 		data = &defdata;
 	}
-- 
2.0.1


^ permalink raw reply related

* Re: [PATCH v2] pwm-backlight: fix probing from device-tree without enable-gpios
From: Alexandre Courbot @ 2014-07-25 14:46 UTC (permalink / raw)
  To: Michael Olbrich
  Cc: Thierry Reding, Bryan Wu, Lee Jones, Alexandre Courbot,
	linux-pwm@vger.kernel.org, linux-fbdev@vger.kernel.org,
	Linux Kernel Mailing List, Sascha Hauer
In-Reply-To: <1406288841-23140-1-git-send-email-m.olbrich@pengutronix.de>

On Fri, Jul 25, 2014 at 8:47 PM, Michael Olbrich
<m.olbrich@pengutronix.de> wrote:
> Since 257462dbf3ed ("pwm-backlight: switch to gpiod interface")
> enable_gpio is no longer set and remains 0 when probing from
> device-tree. This is a valid gpio number. With no enable-gpios
> specified in the device-tree this is used and probing fails
> with:
>
> pwm-backlight lcd-backlight.3: failed to request GPIO#0: -16
>
> Fix this by setting enable_gpio to -1 which is not a valid gpio
> number.

Looks good indeed. My bad for overlooking this.

Acked-by: Alexandre Courbot <acourbot@nvidia.com>

>
> Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
> ---
>
> Sorry, I sent the wrong version. This one actually compiles.
>
> Michael
>
>  drivers/video/backlight/pwm_bl.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c
> index 38ca88b..e7e43cd 100644
> --- a/drivers/video/backlight/pwm_bl.c
> +++ b/drivers/video/backlight/pwm_bl.c
> @@ -211,6 +211,7 @@ static int pwm_backlight_probe(struct platform_device *pdev)
>                         dev_err(&pdev->dev, "failed to find platform data\n");
>                         return ret;
>                 }
> +               defdata.enable_gpio = -1;
>
>                 data = &defdata;
>         }
> --
> 2.0.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fbdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v2] video: fbdev: uvesafb.c: Added additional error checking
From: Rickard Strandqvist @ 2014-07-26 10:19 UTC (permalink / raw)
  To: Wang YanQing, Rickard Strandqvist,
	Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Jingoo Han,
	David Fries, Greg Kroah-Hartman, Joe Perches,
	Linux Fbdev development list, linux-kernel@vger.kernel.org,
	Pavel Machek
In-Reply-To: <20140724173613.GA2203@udknight>

2014-07-24 19:36 GMT+02:00 Wang YanQing <udknight@gmail.com>:
> On Wed, Jul 23, 2014 at 11:20:27PM +0200, Rickard Strandqvist wrote:
>> Variable was assigned a value that is never used.
>> Now the variable is used, and the function returns if a call to
>> uvesafb_exec() returns a error.
>
> Because the only user of uvesafb_vbe_getpmi in uvesafb.c
> don't check its return value, it should do the check indeed,
> so maybe below change is better:
>
> -       if ((task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
> +       if (err || (task->t.regs.eax & 0xffff) != 0x4f || task->t.regs.es < 0xc000) {
>                 par->pmi_setpal = par->ypan = 0;
>         }
>
> Or we check uvesafb_vbe_getpmi's return value, then the code will looks like below:
>
> if (uvesafb_vbe_getpmi(task, par))
>     par->pmi_setpal = par->ypan = 0;


Hi

Sure, I saw that much of the other code using something like:
if (err || ...)


But this whole discussion start with that you wished it would return
the error, and then error code I assumed?

Ok, but something like this then?

err = uvesafb_exec(task);
if (err) {
  par->pmi_setpal = par->ypan = 0;
  return err;
}


Kind regards
Rickard Strandqvist

^ permalink raw reply

* [PATCH] video: clcd-versatile: Depend on ARM
From: Mark Brown @ 2014-07-27 17:04 UTC (permalink / raw)
  To: linux-arm-kernel

From: Mark Brown <broonie@linaro.org>

The Versatile CLCD helpers call dma_alloc_writecombine() which is only
available on ARM and AVR32, meaning they won't build on other platforms
including arm64. Unfortunately the current Kconfig enables the symbol
by default if ARCH_VEXPRESS is defined which means that it is enabled on
arm64 when building for the ARM reference platforms and models for ARMv8
since they have many hardware similarities with their pre-ARMv8 systems.

Since all the systems that need the helpers are ARM systems fix this by
adding a dependency on ARM.

Signed-off-by: Mark Brown <broonie@linaro.org>
---
 drivers/video/fbdev/Kconfig | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index e83ed760141b..ce7c76676a70 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -293,6 +293,7 @@ config FB_ARMCLCD
 # Helper logic selected only by the ARM Versatile platform family.
 config PLAT_VERSATILE_CLCD
 	def_bool ARCH_VERSATILE || ARCH_REALVIEW || ARCH_VEXPRESS
+	depends on ARM
 	depends on FB_ARMCLCD && FB=y
 
 config FB_ACORN
-- 
2.0.1


^ permalink raw reply related

* Re: [PATCH] video: clcd-versatile: Depend on ARM
From: Arnd Bergmann @ 2014-07-28  8:54 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406480658-27243-1-git-send-email-broonie@kernel.org>

On Sunday 27 July 2014 18:04:18 Mark Brown wrote:
> From: Mark Brown <broonie@linaro.org>
> 
> The Versatile CLCD helpers call dma_alloc_writecombine() which is only
> available on ARM and AVR32, meaning they won't build on other platforms
> including arm64. Unfortunately the current Kconfig enables the symbol
> by default if ARCH_VEXPRESS is defined which means that it is enabled on
> arm64 when building for the ARM reference platforms and models for ARMv8
> since they have many hardware similarities with their pre-ARMv8 systems.
> 
> Since all the systems that need the helpers are ARM systems fix this by
> adding a dependency on ARM.
> 
> Signed-off-by: Mark Brown <broonie@linaro.org>

I guess this one is for me, as the bug only exists in linux-next through
arm-soc, introduced by my previous fix for another bug.

Applied to next/cleanup, thanks a lot for fixing it!

	Arnd

^ permalink raw reply

* Re: [rusty:modules-next 4/7] include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_
From: Rusty Russell @ 2014-07-28 11:43 UTC (permalink / raw)
  To: linux-fbdev

Thanks robot!

Looks like drivers/video/fbdev/s3c2410fb.c has a world-writable debug
file.  If you really want this I'll have to make an exception,
otherwise, please ack this patch:


drivers/video/fbdev/s3c2410fb.c: don't make debug world-writable.

We don't want random users to be able to spam the logs, and commit
37549e94c77a94a9c32b5ae3313a3801cb66adf9 (sysfs: disallow
world-writable files.) finally makes this a build error.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>.    

diff --git a/drivers/video/fbdev/s3c2410fb.c b/drivers/video/fbdev/s3c2410fb.c
index 81af5a63e9e1..6796d9d6c871 100644
--- a/drivers/video/fbdev/s3c2410fb.c
+++ b/drivers/video/fbdev/s3c2410fb.c
@@ -616,7 +616,7 @@ static int s3c2410fb_debug_store(struct device *dev,
 	return len;
 }
 
-static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store);
+static DEVICE_ATTR(debug, 0664, s3c2410fb_debug_show, s3c2410fb_debug_store);
 
 static struct fb_ops s3c2410fb_ops = {
 	.owner		= THIS_MODULE,

Cheers,
Rusty.

kbuild test robot <fengguang.wu@intel.com> writes:

> tree:   git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux.git modules-next
> head:   2e3a10a1551d6ceea005e6a62ca58183b8976217
> commit: 37549e94c77a94a9c32b5ae3313a3801cb66adf9 [4/7] sysfs: disallow world-writable files.
> config: make ARCH=arm s3c2410_defconfig
>
> All warnings:
>
>    In file included from include/linux/thread_info.h:11:0,
>                     from include/asm-generic/preempt.h:4,
>                     from arch/arm/include/generated/asm/preempt.h:1,
>                     from include/linux/preempt.h:18,
>                     from include/linux/spinlock.h:50,
>                     from include/linux/seqlock.h:35,
>                     from include/linux/time.h:5,
>                     from include/linux/stat.h:18,
>                     from include/linux/module.h:10,
>                     from drivers/video/fbdev/s3c2410fb.c:16:
>    include/linux/bug.h:33:45: error: negative width in bit-field '<anonymous>'
>     #define BUILD_BUG_ON_ZERO(e) (sizeof(struct { int:-!!(e); }))
>                                                 ^
>    include/linux/kernel.h:853:3: note: in expansion of macro 'BUILD_BUG_ON_ZERO'
>       BUILD_BUG_ON_ZERO((perms) & 2) +    \
>       ^
>>> include/linux/sysfs.h:75:12: note: in expansion of macro 'VERIFY_OCTAL_PERMISSIONS'
>        .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },  \
>                ^
>>> include/linux/device.h:539:45: note: in expansion of macro '__ATTR'
>      struct device_attribute dev_attr_##_name = __ATTR(_name, _mode, _show, _store)
>                                                 ^
>>> drivers/video/fbdev/s3c2410fb.c:619:8: note: in expansion of macro 'DEVICE_ATTR'
>     static DEVICE_ATTR(debug, 0666, s3c2410fb_debug_show, s3c2410fb_debug_store);
>            ^
>
> vim +/VERIFY_OCTAL_PERMISSIONS +75 include/linux/sysfs.h
>
> 6992f533 Eric W. Biederman  2010-02-11  59  
> ^1da177e Linus Torvalds     2005-04-16  60  struct attribute_group {
> 59f69015 Tejun Heo          2007-09-20  61  	const char		*name;
> 587a1f16 Al Viro            2011-07-23  62  	umode_t			(*is_visible)(struct kobject *,
> d4acd722 James Bottomley    2007-10-31  63  					      struct attribute *, int);
> 59f69015 Tejun Heo          2007-09-20  64  	struct attribute	**attrs;
> 6ab9cea1 Greg Kroah-Hartman 2013-07-14  65  	struct bin_attribute	**bin_attrs;
> ^1da177e Linus Torvalds     2005-04-16  66  };
> ^1da177e Linus Torvalds     2005-04-16  67  
> ^1da177e Linus Torvalds     2005-04-16  68  /**
> ^1da177e Linus Torvalds     2005-04-16  69   * Use these macros to make defining attributes easier. See include/linux/device.h
> ^1da177e Linus Torvalds     2005-04-16  70   * for examples..
> ^1da177e Linus Torvalds     2005-04-16  71   */
> ^1da177e Linus Torvalds     2005-04-16  72  
> 5da5c9c8 Greg Kroah-Hartman 2013-08-21  73  #define __ATTR(_name, _mode, _show, _store) {				\
> 58f86cc8 Rusty Russell      2014-03-24  74  	.attr = {.name = __stringify(_name),				\
> 58f86cc8 Rusty Russell      2014-03-24 @75  		 .mode = VERIFY_OCTAL_PERMISSIONS(_mode) },		\
> aa01aa3c Oliver Schinagl    2013-07-14  76  	.show	= _show,						\
> aa01aa3c Oliver Schinagl    2013-07-14  77  	.store	= _store,						\
> ^1da177e Linus Torvalds     2005-04-16  78  }
> ^1da177e Linus Torvalds     2005-04-16  79  
> aa01aa3c Oliver Schinagl    2013-07-14  80  #define __ATTR_RO(_name) {						\
> aa01aa3c Oliver Schinagl    2013-07-14  81  	.attr	= { .name = __stringify(_name), .mode = S_IRUGO },	\
> aa01aa3c Oliver Schinagl    2013-07-14  82  	.show	= _name##_show,						\
> ^1da177e Linus Torvalds     2005-04-16  83  }
>
> :::::: The code at line 75 was first introduced by commit
> :::::: 58f86cc89c3372d3e61d5b71e5513ec5a0b02848 VERIFY_OCTAL_PERMISSIONS: stricter checking for sysfs perms.
>
> :::::: TO: Rusty Russell <rusty@rustcorp.com.au>
> :::::: CC: Rusty Russell <rusty@rustcorp.com.au>
>
> ---
> 0-DAY kernel build testing backend              Open Source Technology Center
> http://lists.01.org/mailman/listinfo/kbuild                 Intel Corporation

^ permalink raw reply related

* Re: [PATCH v9] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2014-07-29 11:06 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406023366.25343.44.camel@hornet>

On Tue, 2014-07-22 at 11:02 +0100, Pawel Moll wrote:
> On Tue, 2014-07-08 at 14:06 +0100, Pawel Moll wrote:
> > On Tue, 2014-06-24 at 12:55 +0100, Pawel Moll wrote:
> > > This patch adds basic DT bindings for the PL11x CLCD cells
> > > and make their fbdev driver use them.
> > > 
> > > Signed-off-by: Pawel Moll <pawel.moll@arm.com>
> > 
> > As two weeks passed without any further comment, I'm assuming that there
> > are no more obstacles for this patch to be merged.
> > 
> > Tomi, will you pick it up for 3.17, as you offered? Russell, if you
> > prefer to take it via your tree, it's in your system as 8005/4.
> 
> Ping...
> 
> Tomi?

... and again...

Regards

Pawel


^ permalink raw reply

* Re: [PATCH v9] video: ARM CLCD: Add DT support
From: Tomi Valkeinen @ 2014-07-29 11:15 UTC (permalink / raw)
  To: linux-arm-kernel
In-Reply-To: <1406631987.17155.0.camel@hornet>

[-- Attachment #1: Type: text/plain, Size: 750 bytes --]

Hi,

On 29/07/14 14:06, Pawel Moll wrote:
> On Tue, 2014-07-22 at 11:02 +0100, Pawel Moll wrote:
>> On Tue, 2014-07-08 at 14:06 +0100, Pawel Moll wrote:
>>> On Tue, 2014-06-24 at 12:55 +0100, Pawel Moll wrote:
>>>> This patch adds basic DT bindings for the PL11x CLCD cells
>>>> and make their fbdev driver use them.
>>>>
>>>> Signed-off-by: Pawel Moll <pawel.moll@arm.com>
>>>
>>> As two weeks passed without any further comment, I'm assuming that there
>>> are no more obstacles for this patch to be merged.
>>>
>>> Tomi, will you pick it up for 3.17, as you offered? Russell, if you
>>> prefer to take it via your tree, it's in your system as 8005/4.
>>
>> Ping...
>>
>> Tomi?

Yep, I've queued it now for 3.17.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Re: [PATCH 3/3] driver:gpio remove all usage of gpio_remove retval in driver
From: Tomi Valkeinen @ 2014-07-29 11:30 UTC (permalink / raw)
  To: Linus Walleij, abdoulaye berthe, arm@kernel.org, Ralf Baechle,
	Benjamin Herrenschmidt, Rafał Miłecki, Jiri Kosina,
	Dmitry Torokhov, Bryan Wu, Mauro Carvalho Chehab, Lee Jones,
	Samuel Ortiz, Matthew Garrett, Michael Buesch, Greg KH,
	Mark Brown, Liam Girdwood
  Cc: Alexandre Courbot, linux-gpio@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-mips,
	linux-sh@vger.kernel.org, Linux Input,
	linux-media@vger.kernel.org, linux-serial@vger.kernel.org,
	linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org
In-Reply-To: <CACRpkdasp9bLULT7NJM9nYX58rRSsQKXFddOLz9Ah6kp-j-3=Q@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 450 bytes --]

On 22/07/14 18:08, Linus Walleij wrote:
> On Sat, Jul 12, 2014 at 10:30 PM, abdoulaye berthe <berthe.ab@gmail.com> wrote:
> 
> Heads up. Requesting ACKs for this patch or I'm atleast warning that it will be
> applied. We're getting rid of the return value from gpiochip_remove().

>>  drivers/video/fbdev/via/via-gpio.c             | 10 +++-------
> 
> Tomi can you ACK this?

Acked-by: Tomi Valkeinen <tomi.valkeinen@ti.com>

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

^ permalink raw reply

* Mailbox Warning
From: Webmail Admin @ 2014-07-29 12:27 UTC (permalink / raw)
  To: Recipients

Email Account Warning !!!

This mail is from Administrator; we wish to bring to your notice the Condition of your email account.
We have just noticed that you have exceeded your email Database limit of 500 MB quota and your email IP is causing conflict because it is been accessed in different server location. You need to Upgrade and expand your email quota limit before you can continue to use your email. Provide details or click the link below :


Update your email quota limit to 2.6 GB, use the below web link:
      https://www.formlogix.com/Manager/UserConditionalSurvey248582.aspx?Param=VXNlcklkPTI0ODU4Mi5Gb3JtSWQ9MQ%3d%3d

Failure to do this will result to email deactivation within 24hours
Thank you for your understanding.

Copyright 2014 Help Desk
Email Upgrade 

^ permalink raw reply

* Mailbox Warning
From: Webmail Admin @ 2014-07-29 15:17 UTC (permalink / raw)
  To: Recipients
In-Reply-To: <20140729121801.E5D1B4D1577@zirius.ipresspublicas.gob.pe>

Email Account Warning !!!

This mail is from Administrator; we wish to bring to your notice the Condition of your email account.
We have just noticed that you have exceeded your email Database limit of 500 MB quota and your email IP is causing conflict because it is been accessed in different server location. You need to Upgrade and expand your email quota limit before you can continue to use your email. Provide details or click the link below :


Update your email quota limit to 2.6 GB, use the below web link:
      https://www.formlogix.com/Manager/UserConditionalSurvey248587.aspx?Param=VXNlcklkPTI0ODU4Ny5Gb3JtSWQ9MQ%3d%3d

Failure to do this will result to email deactivation within 24hours
Thank you for your understanding.

Copyright 2014 Help Desk
Email Upgrade 

^ permalink raw reply

* Re: [PATCH -next] backlight: ipaq_micro: Fix sparse non static symbol warning
From: Bryan Wu @ 2014-07-29 23:25 UTC (permalink / raw)
  To: linux-fbdev

On Tue, Jul 29, 2014 at 4:20 PM,  <weiyj_lk@163.com> wrote:
> From: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
>
> Fixes the following sparse warnings:
>
> drivers/video/backlight/ipaq_micro_bl.c:73:24: warning:
>  symbol 'micro_backlight_device_driver' was not declared. Should it be static?
>

I've merged a similar fix for led-ipaq-micro. So this one looks good to me:

Acked-by: Bryan Wu <cooloney@gmail.com>

> Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
> ---
>  drivers/video/backlight/ipaq_micro_bl.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/video/backlight/ipaq_micro_bl.c b/drivers/video/backlight/ipaq_micro_bl.c
> index feab29c..347dc11 100644
> --- a/drivers/video/backlight/ipaq_micro_bl.c
> +++ b/drivers/video/backlight/ipaq_micro_bl.c
> @@ -70,7 +70,7 @@ static int micro_backlight_probe(struct platform_device *pdev)
>         return 0;
>  }
>
> -struct platform_driver micro_backlight_device_driver = {
> +static struct platform_driver micro_backlight_device_driver = {
>         .driver = {
>                 .name    = "ipaq-micro-backlight",
>         },
>

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox