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lrZSB0byByZXZpc2UgdGhlIHBhdGNoIHRvIHVzZSBOVUxMIGFzIGEg
cmVzdWx0CmlmIHRoZXJlIGlzIG5vIHN1cHBvcnQgTENEX0NMQVNTX0RFVklDRSBpbiB0aGUga2Vy
bmVsLgpBZGRpdGlvbmFsbHksIEkgaGF2ZSBhIHBsYW4gdG8gY29udmVydCAibWVudWNvbmZpZyIg
ZW50cnkgZm9yCkJBQ0tMSUdIVF9MQ0RfU1VQUE9SVCB0byB0aGUgIm1lbnUiLgpPSz8KCi0tLQo
^ permalink raw reply
* Re: [PATCH] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set
From: Tomi Valkeinen @ 2014-03-13 9:04 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1394695879-22845-1-git-send-email-shc_work@mail.ru>
[-- Attachment #1: Type: text/plain, Size: 1975 bytes --]
On 13/03/14 10:48, Alexander Shiyan wrote:
> Четверг, 13 марта 2014, 10:23 +02:00 от Tomi Valkeinen <tomi.valkeinen@ti.com>:
>> On 13/03/14 09:31, Alexander Shiyan wrote:
>>> Provide dummy functions for LCD register()/unregister() if
>>> CONFIG_LCD_CLASS_DEVICE is not set.
>>
>> Hmm, why do you want to do that? If a driver needs the LCD class, it
>> should depend on or select it.
>
> I inspect my recent changes for the imxfb driver.
> I use the LCD class for power management and contrast, nevertheless,
> if it lack in the kernel this leads to an error.
So is the CONFIG_LCD_CLASS_DEVICE optional for imxfb? It works fine with
or without the LCD class support? Is there some reason to run it without
LCD class support?
> Yes, we can choose the LCD_CLASS_DEVICE symbol for the imxfb driver,
> but at the same time we must choose BACKLIGHT_LCD_SUPPORT.
> I do not think it's a good way.
Why not?
> In any case, I would like to revise the patch to use NULL as a result
> if there is no support LCD_CLASS_DEVICE in the kernel.
Why do you want to run imxfb without LCD_CLASS_DEVICE? Isn't it simpler
to just depend on it?
> Additionally, I have a plan to convert "menuconfig" entry for
> BACKLIGHT_LCD_SUPPORT to the "menu".
Hmm. That does make sense, as I don't see BACKLIGHT_LCD_SUPPORT
affecting anything, except enabling the BL & LCD Kconfig menu.
However, many of the items in BL & LCD menu have, for some reason,
"default y" or "default m". So if you make BACKLIGHT_LCD_SUPPORT a menu,
it means all those subitems are always enabled. So there definitely will
be a side effect to that change.
I guess there's legacy reasons why many of the items are enabled by
default. It would make sense to me to have BACKLIGHT_LCD_SUPPORT as a
menu, as you suggest, and having all the subitems disabled by default.
But again, that would change the current behavior, which may or may not
cause issues.
Tomi
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 901 bytes --]
^ permalink raw reply
* Re: [PATCH] lcd: Provide dummy functions if C =?UTF-8?B?T05GSUdfTENEX0NMQ
From: Alexander Shiyan @ 2014-03-13 9:26 UTC (permalink / raw)
To: linux-fbdev
In-Reply-To: <1394700536.448009775@f174.i.mail.ru>
0KfQtdGC0LLQtdGA0LMsIDEzINC80LDRgNGC0LAgMjAxNCwgMTE6MDQgKzAyOjAwINC+0YIgVG9t
aSBWYWxrZWluZW4gPHRvbWkudmFsa2VpbmVuQHRpLmNvbT46Cj4gT24gMTMvMDMvMTQgMTA6NDgs
IEFsZXhhbmRlciBTaGl5YW4gd3JvdGU6Cj4gPiDQp9C10YLQstC10YDQsywgMTMg0LzQsNGA0YLQ
sCAyMDE0LCAxMDoyMyArMDI6MDAg0L7RgiBUb21pIFZhbGtlaW5lbiA8dG9taS52YWxrZWluZW5A
dGkuY29tPjoKPiA+PiBPbiAxMy8wMy8xNCAwOTozMSwgQWxleGFuZGVyIFNoaXlhbiB3cm90ZToK
PiA+Pj4gUHJvdmlkZSBkdW1teSBmdW5jdGlvbnMgZm9yIExDRCByZWdpc3RlcigpL3VucmVnaXN0
ZXIoKSBpZgo+ID4+PiBDT05GSUdfTENEX0NMQVNTX0RFVklDRSBpcyBub3Qgc2V0Lgo+ID4+Cj4g
Pj4gSG1tLCB3aHkgZG8geW91IHdhbnQgdG8gZG8gdGhhdD8gSWYgYSBkcml2ZXIgbmVlZHMgdG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:21 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> Hi Pawel,
>
> On 05/03/14 18:23, Pawel Moll wrote:
>> This patch adds basic DT bindings for the PL11x CLCD cells
>> and make their fbdev driver use them.
>
> Is this an old HW, and presumably there won't be new users for it?
AFAICT ARM really like to re-synthesize this piece of HW in every
new reference design they make. Plus a number of manufacturers
have used it in elder systems.
> If
> yes, this is probably fine. If not, you might want to look at the video
> ports and endpoints, which is used by at least three not-yet-merged series:
>
> [PATCHv3 00/41] OMAPDSS: DT support v3
> [PATCH v5 00/11] imx-drm dt bindings
> [RFC PATCH v2 00/21] Add DSI display support for Exynos based boards
>
> Using bindings like that would be more future proof, even if the current
> driver doesn't use them.
I take it that it shouldn't matter if the driver is for framebuffer or
DRM (as was implied by some answer here) the hardware
description should be the same no matter what, so the more
furture-proof the better.
Yours,
Linus Walleij
^ permalink raw reply
* [PATCH v3] backlight: add new LP8860 backlight driver
From: Daniel Jeong @ 2014-03-13 10:28 UTC (permalink / raw)
To: Jingoo Han
Cc: Daniel Jeong, linux-fbdev, linux-kernel,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Bryan Wu,
Lee Jones
This patch adds LP8860 backlight device driver.
LP8860 is a low EMI and High performance 4 channel LED Driver of TI.
This device driver provides the way to control brightness and current
of each channel and provides the way to change values in the eeprom.
Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
---
To support dt structure, another patch file will be sent.
changes since v2
- removed some magic number.
- fixed the possibility to refer null when backlight is removed.
---
drivers/video/backlight/Kconfig | 7 +
drivers/video/backlight/Makefile | 1 +
drivers/video/backlight/lp8860_bl.c | 526 +++++++++++++++++++++++++++++++
include/linux/platform_data/lp8860_bl.h | 54 ++++
4 files changed, 588 insertions(+)
create mode 100644 drivers/video/backlight/lp8860_bl.c
create mode 100644 include/linux/platform_data/lp8860_bl.h
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 5a3eb2e..908048f 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -397,6 +397,13 @@ config BACKLIGHT_LP8788
help
This supports TI LP8788 backlight driver.
+config BACKLIGHT_LP8860
+ tristate "Backlight Driver for LP8860"
+ depends on BACKLIGHT_CLASS_DEVICE && I2C
+ select REGMAP_I2C
+ help
+ This supports TI LP8860 Backlight Driver
+
config BACKLIGHT_OT200
tristate "Backlight driver for ot200 visualisation device"
depends on BACKLIGHT_CLASS_DEVICE && CS5535_MFGPT && GPIO_CS5535
diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
index bb82002..cbc5ac3 100644
--- a/drivers/video/backlight/Makefile
+++ b/drivers/video/backlight/Makefile
@@ -42,6 +42,7 @@ obj-$(CONFIG_BACKLIGHT_LM3639) += lm3639_bl.o
obj-$(CONFIG_BACKLIGHT_LOCOMO) += locomolcd.o
obj-$(CONFIG_BACKLIGHT_LP855X) += lp855x_bl.o
obj-$(CONFIG_BACKLIGHT_LP8788) += lp8788_bl.o
+obj-$(CONFIG_BACKLIGHT_LP8860) += lp8860_bl.o
obj-$(CONFIG_BACKLIGHT_LV5207LP) += lv5207lp.o
obj-$(CONFIG_BACKLIGHT_MAX8925) += max8925_bl.o
obj-$(CONFIG_BACKLIGHT_OMAP1) += omap1_bl.o
diff --git a/drivers/video/backlight/lp8860_bl.c b/drivers/video/backlight/lp8860_bl.c
new file mode 100644
index 0000000..e17e94f
--- /dev/null
+++ b/drivers/video/backlight/lp8860_bl.c
@@ -0,0 +1,526 @@
+/*
+* Simple driver for Texas Instruments lp8860 Backlight driver chip
+*
+* 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/i2c.h>
+#include <linux/module.h>
+#include <linux/platform_data/lp8860_bl.h>
+#include <linux/regmap.h>
+#include <linux/slab.h>
+#include <linux/uaccess.h>
+
+#define REG_CL0_BRT_H 0x00
+#define REG_CL0_BRT_L 0x01
+#define REG_CL0_I_H 0x02
+#define REG_CL0_I_L 0x03
+
+#define REG_CL1_BRT_H 0x04
+#define REG_CL1_BRT_L 0x05
+#define REG_CL1_I 0x06
+
+#define REG_CL2_BRT_H 0x07
+#define REG_CL2_BRT_L 0x08
+#define REG_CL2_I 0x09
+
+#define REG_CL3_BRT_H 0x0a
+#define REG_CL3_BRT_L 0x0b
+#define REG_CL3_I 0x0c
+
+#define REG_CONF 0x0d
+#define REG_STATUS 0x0e
+#define REG_ID 0x12
+
+#define REG_ROM_CTRL 0x19
+#define REG_ROM_UNLOCK 0x1a
+#define REG_ROM_START 0x60
+#define REG_ROM_END 0x78
+
+#define REG_EEPROM_START 0x60
+#define REG_EEPROM_END 0x78
+#define REG_MAX 0xFF
+
+struct lp8860_chip {
+ struct device *dev;
+ struct lp8860_platform_data *pdata;
+ struct backlight_device *bled[LP8860_LED_MAX];
+ struct regmap *regmap;
+};
+
+/* brightness control */
+static int lp8860_bled_update_status(struct backlight_device *bl,
+ enum lp8860_leds nsr)
+{
+ int ret = -EINVAL;
+ struct lp8860_chip *pchip = bl_get_data(bl);
+
+ if (pchip->pdata->mode)
+ return 0;
+
+ if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+ bl->props.brightness = 0;
+
+ switch (nsr) {
+ case LP8860_LED0:
+ ret = regmap_write(pchip->regmap,
+ REG_CL0_BRT_H, bl->props.brightness >> 8);
+ ret |= regmap_write(pchip->regmap,
+ REG_CL0_BRT_L, bl->props.brightness & 0xff);
+ break;
+ case LP8860_LED1:
+ ret = regmap_write(pchip->regmap,
+ REG_CL1_BRT_H,
+ (bl->props.brightness >> 8) & 0x1f);
+ ret |= regmap_write(pchip->regmap,
+ REG_CL1_BRT_L, bl->props.brightness & 0xff);
+ break;
+ case LP8860_LED2:
+ ret = regmap_write(pchip->regmap,
+ REG_CL2_BRT_H,
+ (bl->props.brightness >> 8) & 0x1f);
+ ret |= regmap_write(pchip->regmap,
+ REG_CL2_BRT_L, bl->props.brightness & 0xff);
+ break;
+ case LP8860_LED3:
+ ret = regmap_write(pchip->regmap,
+ REG_CL3_BRT_H,
+ (bl->props.brightness >> 8) & 0x1f);
+ ret |= regmap_write(pchip->regmap,
+ REG_CL3_BRT_L, bl->props.brightness & 0xff);
+ break;
+ default:
+ BUG();
+ }
+ if (ret < 0)
+ dev_err(pchip->dev, "fail : i2c access to register.\n");
+ else
+ ret = bl->props.brightness;
+
+ return ret;
+}
+
+static int lp8860_bled_get_brightness(struct backlight_device *bl,
+ enum lp8860_leds nsr)
+{
+ struct lp8860_chip *pchip = bl_get_data(bl);
+ unsigned int rval_h, rval_l;
+ int ret = -EINVAL;
+
+ switch (nsr) {
+ case LP8860_LED0:
+ ret = regmap_read(pchip->regmap, REG_CL0_BRT_H, &rval_h);
+ ret |= regmap_read(pchip->regmap, REG_CL0_BRT_L, &rval_l);
+ break;
+ case LP8860_LED1:
+ ret = regmap_read(pchip->regmap, REG_CL1_BRT_H, &rval_h);
+ ret |= regmap_read(pchip->regmap, REG_CL1_BRT_L, &rval_l);
+ break;
+ case LP8860_LED2:
+ ret = regmap_read(pchip->regmap, REG_CL2_BRT_H, &rval_h);
+ ret |= regmap_read(pchip->regmap, REG_CL2_BRT_L, &rval_l);
+ break;
+ case LP8860_LED3:
+ ret = regmap_read(pchip->regmap, REG_CL3_BRT_H, &rval_h);
+ ret |= regmap_read(pchip->regmap, REG_CL3_BRT_L, &rval_l);
+ break;
+ default:
+ BUG();
+ }
+ if (ret < 0) {
+ dev_err(pchip->dev, "fail : i2c access to register.\n");
+ return ret;
+ }
+ bl->props.brightness = (rval_h << 8) | rval_l;
+ return bl->props.brightness;
+}
+
+static int lp8860_update_status_bled0(struct backlight_device *bl)
+{
+ return lp8860_bled_update_status(bl, LP8860_LED0);
+}
+
+static int lp8860_get_brightness_bled0(struct backlight_device *bl)
+{
+ return lp8860_bled_get_brightness(bl, LP8860_LED0);
+}
+
+static int lp8860_update_status_bled1(struct backlight_device *bl)
+{
+ return lp8860_bled_update_status(bl, LP8860_LED1);
+}
+
+static int lp8860_get_brightness_bled1(struct backlight_device *bl)
+{
+ return lp8860_bled_get_brightness(bl, LP8860_LED1);
+}
+
+static int lp8860_update_status_bled2(struct backlight_device *bl)
+{
+ return lp8860_bled_update_status(bl, LP8860_LED2);
+}
+
+static int lp8860_get_brightness_bled2(struct backlight_device *bl)
+{
+ return lp8860_bled_get_brightness(bl, LP8860_LED2);
+}
+
+static int lp8860_update_status_bled3(struct backlight_device *bl)
+{
+ return lp8860_bled_update_status(bl, LP8860_LED3);
+}
+
+static int lp8860_get_brightness_bled3(struct backlight_device *bl)
+{
+ return lp8860_bled_get_brightness(bl, LP8860_LED3);
+}
+
+#define lp8860_bled_ops(_id)\
+{\
+ .options = BL_CORE_SUSPENDRESUME,\
+ .update_status = lp8860_update_status_bled##_id,\
+ .get_brightness = lp8860_get_brightness_bled##_id,\
+}
+
+static const struct backlight_ops lp8860_bled_ops[LP8860_LED_MAX] = {
+ [LP8860_LED0] = lp8860_bled_ops(0),
+ [LP8860_LED1] = lp8860_bled_ops(1),
+ [LP8860_LED2] = lp8860_bled_ops(2),
+ [LP8860_LED3] = lp8860_bled_ops(3),
+};
+
+/* current control */
+static int lp8860_set_current(struct device *dev,
+ const char *buf, enum lp8860_leds nsr)
+{
+ struct lp8860_chip *pchip = dev_get_drvdata(dev);
+ unsigned int ival;
+ ssize_t ret;
+
+ ret = kstrtouint(buf, 10, &ival);
+ if (ret)
+ return ret;
+
+ switch (nsr) {
+ case LP8860_LED0:
+ ival = min_t(unsigned int, ival, LP8860_LED0_BR_MAX);
+ ret = regmap_write(pchip->regmap, REG_CL0_I_H, ival >> 8);
+ ret |= regmap_write(pchip->regmap, REG_CL0_I_L, ival & 0xff);
+ break;
+ case LP8860_LED1:
+ ival = min_t(unsigned int, ival, LP8860_LED1_BR_MAX);
+ ret = regmap_write(pchip->regmap, REG_CL1_I, ival & 0xff);
+ break;
+ case LP8860_LED2:
+ ival = min_t(unsigned int, ival, LP8860_LED2_BR_MAX);
+ ret = regmap_write(pchip->regmap, REG_CL2_I, ival & 0xff);
+ break;
+ case LP8860_LED3:
+ ival = min_t(unsigned int, ival, LP8860_LED3_BR_MAX);
+ ret = regmap_write(pchip->regmap, REG_CL3_I, ival & 0xff);
+ break;
+ default:
+ BUG();
+ }
+ if (ret < 0)
+ dev_err(pchip->dev, "fail : i2c access error.\n");
+
+ return ret;
+}
+
+static ssize_t lp8860_current_store_bled0(struct device *dev,
+ struct device_attribute *devAttr,
+ const char *buf, size_t size)
+{
+ int ret;
+
+ ret = lp8860_set_current(dev, buf, LP8860_LED0);
+ if (ret < 0)
+ return ret;
+ return size;
+}
+
+static ssize_t lp8860_current_store_bled1(struct device *dev,
+ struct device_attribute *devAttr,
+ const char *buf, size_t size)
+{
+ int ret;
+
+ ret = lp8860_set_current(dev, buf, LP8860_LED1);
+ if (ret < 0)
+ return ret;
+ return size;
+}
+
+static ssize_t lp8860_current_store_bled2(struct device *dev,
+ struct device_attribute *devAttr,
+ const char *buf, size_t size)
+{
+ int ret;
+
+ ret = lp8860_set_current(dev, buf, LP8860_LED2);
+ if (ret < 0)
+ return ret;
+ return size;
+}
+
+static ssize_t lp8860_current_store_bled3(struct device *dev,
+ struct device_attribute *devAttr,
+ const char *buf, size_t size)
+{
+ int ret;
+
+ ret = lp8860_set_current(dev, buf, LP8860_LED3);
+ if (ret < 0)
+ return ret;
+ return size;
+}
+
+#define lp8860_attr(_name, _show, _store)\
+{\
+ .attr = {\
+ .name = _name,\
+ .mode = S_IWUSR,\
+ },\
+ .show = _show,\
+ .store = _store,\
+}
+
+static struct device_attribute lp8860_dev_attr[LP8860_LED_MAX] = {
+ [LP8860_LED0] = lp8860_attr("current", NULL,
+ lp8860_current_store_bled0),
+ [LP8860_LED1] = lp8860_attr("current", NULL,
+ lp8860_current_store_bled1),
+ [LP8860_LED2] = lp8860_attr("current", NULL,
+ lp8860_current_store_bled2),
+ [LP8860_LED3] = lp8860_attr("current", NULL,
+ lp8860_current_store_bled3),
+};
+
+/*
+ * eeprom write and readback to check.
+ * eeprom register range is from 60h to 78h
+ * buffer value to write data [reg] [data]
+ * e.g) to change the register 0x60 value to 0xff
+ * buffer value should be 60 ff
+ */
+static ssize_t lp8860_eeprom_store(struct device *dev,
+ struct device_attribute *devAttr,
+ const char *buf, size_t size)
+{
+ struct lp8860_chip *pchip = dev_get_drvdata(dev);
+ unsigned int reg, data, rval;
+ char *tok;
+ int ret;
+
+ /* register no. */
+ tok = strsep((char **)&buf, " ,\n");
+ if (tok = NULL)
+ goto err_input;
+ ret = kstrtouint(tok, 16, ®);
+ if (ret)
+ goto err_input;
+
+ /* register value */
+ tok = strsep((char **)&buf, " ,\n");
+ if (tok = NULL)
+ goto err_input;
+ ret = kstrtouint(tok, 16, &data);
+ if (ret)
+ goto err_input;
+ /*
+ * EEPROM Programming sequence
+ * (program data permanently from registers to NVM)
+ * 1. Unlock EEPROM by writing
+ * the unlock codes to register 1Ah(08, BA, EF)
+ * 2. Write data to EEPROM registers (address 60h...78h)
+ * 3. Write EE_PROG to 1 in address 19h. (02h to address 19h)
+ * 4. Wait 100ms for chip interanl dealy to access the eeprom
+ * 5. Write EE_PROG to 0 in address 19h. (00h to address 19h)
+ */
+ if (reg < REG_EEPROM_START || reg > REG_EEPROM_END || data > 0xff)
+ goto err_input;
+ ret = regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0x08);
+ ret |= regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0xba);
+ ret |= regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0xef);
+ ret |= regmap_write(pchip->regmap, reg, data);
+ ret |= regmap_write(pchip->regmap, REG_ROM_CTRL, 0x02);
+ msleep(100);
+ ret |= regmap_write(pchip->regmap, REG_ROM_CTRL, 0x00);
+ if (ret < 0)
+ goto err_i2c;
+
+ /* read back */
+ ret = regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0x08);
+ ret |= regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0xba);
+ ret |= regmap_write(pchip->regmap, REG_ROM_UNLOCK, 0xef);
+ ret |= regmap_write(pchip->regmap, REG_ROM_CTRL, 0x01);
+ msleep(100);
+ ret |= regmap_write(pchip->regmap, REG_ROM_CTRL, 0x00);
+ ret |= regmap_read(pchip->regmap, reg, &rval);
+ if (ret < 0)
+ goto err_i2c;
+ if (rval != data)
+ dev_err(pchip->dev, "fail : eeprom did not change.\n");
+
+ return size;
+
+err_i2c:
+ dev_err(pchip->dev, "fail : i2c access error.\n");
+ return ret;
+
+err_input:
+ dev_err(pchip->dev, "fail : input fail.\n");
+ return -EINVAL;
+}
+
+static DEVICE_ATTR(eeprom, S_IWUSR, NULL, lp8860_eeprom_store);
+
+/* backlight register and remove */
+static char *lp8860_bled_name[LP8860_LED_MAX] = {
+ [LP8860_LED0] = "bled0",
+ [LP8860_LED1] = "bled1",
+ [LP8860_LED2] = "bled2",
+ [LP8860_LED3] = "bled3",
+};
+
+static int lp8860_backlight_remove(struct lp8860_chip *pchip)
+{
+ int icnt;
+
+ for (icnt = LP8860_LED0; icnt < LP8860_LED_MAX; icnt++) {
+ if (pchip->bled[icnt])
+ device_remove_file(&(pchip->bled[icnt]->dev),
+ &lp8860_dev_attr[icnt]);
+ }
+ return 0;
+}
+
+static int lp8860_backlight_registers(struct lp8860_chip *pchip)
+{
+ struct backlight_properties props;
+ struct lp8860_platform_data *pdata = pchip->pdata;
+ int icnt, ret;
+
+ props.type = BACKLIGHT_RAW;
+ for (icnt = LP8860_LED0; icnt < LP8860_LED_MAX; icnt++) {
+ props.max_brightness = pdata->max_brt[icnt];
+ pchip->bled[icnt] + devm_backlight_device_register(pchip->dev,
+ lp8860_bled_name[icnt],
+ pchip->dev, pchip,
+ &lp8860_bled_ops[icnt],
+ &props);
+ if (IS_ERR(pchip->bled[icnt])) {
+ dev_err(pchip->dev, "fail : backlight register.\n");
+ ret = PTR_ERR(pchip->bled[icnt]);
+ goto err_out;
+ }
+ /* to control current */
+ ret = device_create_file(&(pchip->bled[icnt]->dev),
+ &lp8860_dev_attr[icnt]);
+ if (ret < 0) {
+ dev_err(pchip->dev, "fail : to add sysfs entries.\n");
+ goto err_out;
+ }
+ }
+ /* to access eeprom */
+ ret = device_create_file(&(pchip->bled[LP8860_LED0]->dev),
+ &dev_attr_eeprom);
+ if (ret < 0) {
+ dev_err(pchip->dev, "fail : to add sysfs entries.\n");
+ goto err_out;
+ }
+ return 0;
+
+err_out:
+ lp8860_backlight_remove(pchip);
+ return ret;
+}
+
+static const struct regmap_config lp8860_regmap = {
+ .reg_bits = 8,
+ .val_bits = 8,
+ .max_register = REG_MAX,
+};
+
+static int lp8860_probe(struct i2c_client *client,
+ const struct i2c_device_id *id)
+{
+ struct lp8860_chip *pchip;
+ struct lp8860_platform_data *pdata = dev_get_platdata(&client->dev);
+ int ret, icnt;
+
+ if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) {
+ dev_err(&client->dev, "fail : i2c functionality check.\n");
+ return -EOPNOTSUPP;
+ }
+
+ pchip = devm_kzalloc(&client->dev,
+ sizeof(struct lp8860_chip), GFP_KERNEL);
+ if (!pchip)
+ return -ENOMEM;
+ pchip->dev = &client->dev;
+
+ pchip->regmap = devm_regmap_init_i2c(client, &lp8860_regmap);
+ if (IS_ERR(pchip->regmap)) {
+ ret = PTR_ERR(pchip->regmap);
+ dev_err(pchip->dev, "fail : allocate i2c register map.\n");
+ return ret;
+ }
+
+ if (pdata = NULL) {
+ pdata = devm_kzalloc(pchip->dev,
+ sizeof(struct lp8860_platform_data),
+ GFP_KERNEL);
+ if (pdata = NULL)
+ return -ENOMEM;
+ pdata->max_brt[LP8860_LED0] = LP8860_LED0_BR_MAX;
+ for (icnt = LP8860_LED1; icnt < LP8860_LED_MAX; icnt++)
+ pdata->max_brt[icnt] = LP8860_LED1_BR_MAX;
+ }
+ pchip->pdata = pdata;
+
+ i2c_set_clientdata(client, pchip);
+ ret = lp8860_backlight_registers(pchip);
+ return ret;
+}
+
+static int lp8860_remove(struct i2c_client *client)
+{
+ struct lp8860_chip *pchip = i2c_get_clientdata(client);
+
+ device_remove_file(&(pchip->bled[LP8860_LED0]->dev), &dev_attr_eeprom);
+ return lp8860_backlight_remove(i2c_get_clientdata(client));
+}
+
+static const struct i2c_device_id lp8860_id[] = {
+ {LP8860_NAME, 0},
+ {}
+};
+
+MODULE_DEVICE_TABLE(i2c, lp8860_id);
+static struct i2c_driver lp8860_i2c_driver = {
+ .driver = {
+ .name = LP8860_NAME,
+ },
+ .probe = lp8860_probe,
+ .remove = lp8860_remove,
+ .id_table = lp8860_id,
+};
+
+module_i2c_driver(lp8860_i2c_driver);
+
+MODULE_DESCRIPTION("Texas Instruments LP8860 Backlight Driver");
+MODULE_AUTHOR("Daniel Jeong <gshark.jeong@gmail.com>");
+MODULE_AUTHOR("Ldd Mlp <ldd-mlp@list.ti.com>");
+MODULE_LICENSE("GPL v2");
diff --git a/include/linux/platform_data/lp8860_bl.h b/include/linux/platform_data/lp8860_bl.h
new file mode 100644
index 0000000..9edd7cf
--- /dev/null
+++ b/include/linux/platform_data/lp8860_bl.h
@@ -0,0 +1,54 @@
+/*
+ * Simple driver for Texas Instruments LP8860 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 __LP8860_H
+#define __LP8860_H
+
+#define LP8860_NAME "lp8860"
+#define LP8860_ADDR 0x2d
+
+#define LP8860_LED0_BR_MAX 65535
+#define LP8860_LED1_BR_MAX 8191
+#define LP8860_LED2_BR_MAX 8191
+#define LP8860_LED3_BR_MAX 8191
+
+#define LP8860_LED0_I_MAX 4095
+#define LP8860_LED1_I_MAX 255
+#define LP8860_LED2_I_MAX 255
+#define LP8860_LED3_I_MAX 255
+
+enum lp8860_leds {
+ LP8860_LED0 = 0,
+ LP8860_LED1,
+ LP8860_LED2,
+ LP8860_LED3,
+ LP8860_LED_MAX
+};
+
+enum lp8860_ctrl_mode {
+ LP8860_CTRL_I2C = 0,
+ LP8860_CTRL_I2C_PWM,
+};
+
+/* struct lp8860 platform data
+ * @mode : control mode
+ * @max_brt : maximum brightness.
+ * LED0 0 ~ 65535
+ * LED1 0 ~ 8191
+ * LED2 0 ~ 8191
+ * LED3 0 ~ 8191
+ */
+struct lp8860_platform_data {
+
+ enum lp8860_ctrl_mode mode;
+ int max_brt[LP8860_LED_MAX];
+};
+
+#endif /* __LP8860_H */
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v5 1/2] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2014-03-13 11:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CACRpkdYBuxYko5JD5ZCfoQq+PeXtkKP9eprk9HM=ghW2YMoMuA@mail.gmail.com>
On Thu, 2014-03-13 at 09:30 +0000, Linus Walleij wrote:
> On Thu, Mar 6, 2014 at 11:21 AM, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> > On 05/03/14 18:23, Pawel Moll wrote:
> >> This patch adds basic DT bindings for the PL11x CLCD cells
> >> and make their fbdev driver use them.
> >
> > Is this an old HW, and presumably there won't be new users for it?
>
> AFAICT ARM really like to re-synthesize this piece of HW in every
> new reference design they make.
Not for long now, hopefully...
> > If
> > yes, this is probably fine. If not, you might want to look at the video
> > ports and endpoints, which is used by at least three not-yet-merged series:
> >
> > [PATCHv3 00/41] OMAPDSS: DT support v3
> > [PATCH v5 00/11] imx-drm dt bindings
> > [RFC PATCH v2 00/21] Add DSI display support for Exynos based boards
> >
> > Using bindings like that would be more future proof, even if the current
> > driver doesn't use them.
>
> I take it that it shouldn't matter if the driver is for framebuffer or
> DRM (as was implied by some answer here) the hardware
> description should be the same no matter what, so the more
> furture-proof the better.
Again, no argument here - the clcd-specific properties will be of use
whatever happens in the future (the "immediate" display timing subnode
is optional and is cloned from other existing bindings, so no new
problem is introduced here). I'm just shying away from the discussions
on generic display (or CDF or video or whatever) bindings. Call me
coward if you wish (maybe just tired to death with this subject ;-)
Pawel
^ permalink raw reply
* Re: [PATCH v5 1/2] video: ARM CLCD: Add DT support
From: Russell King - ARM Linux @ 2014-03-13 12:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <531DAEB9.3020502@ti.com>
On Mon, Mar 10, 2014 at 02:23:21PM +0200, Tomi Valkeinen wrote:
> On 10/03/14 14:09, Pawel Moll wrote:
>
> >> Note that the same DT bindings you add here should also work for the DRM
> >> driver in the future. So, in fact, the question is extended to: will the
> >> fbdev
> >
> > No, I don't think so. It's a end of line for it, I believe. From my
> > personal point of view the main goal is to fill the last gap between DT
> > and non-DT support on one of the Versatile Express boards - CLCD works
> > fine when booted with ATAGs, doesn't work when booted with DT. It looks
> > bad.
>
> The DT describes the hardware, and there should be only one description
> of it, no matter what the used SW is. I see compatible = "arm,pl111" in
> the dts. PL111 is the LCD controller, right? What will the DRM driver
> use, then, if the "arm,pl111" DT data is designed to work only for the
> fbdev?
If we could move forward with things like DT bindings for DRM (which
seems impossible) then we might be able to move forward with a proper
DT implementation for componentised video systems which would solve
this as you'd have the pl111 as just a CRTC component in a larger
subsystem representation which included things like encoders and
connectors - even for something as simple as the Versatile Express
boards.
These boards have a DVI connector which offers analogue (and probably
digital) output. Previous boards like Versatile and Integrator have
offered VGA output and a connector for various LCD panels (sometimes
the connected LCD panel is identified via a set of GPIOs.)
So, going ahead with some bindings which include stuff like timing
information in a pl111 node seems wrong and boxes us in if we're going
to start representing connectors as well - as the timing should be part
of the panel node or similar.
So basically all movement on display subsystem DT representations is
now blocked because no one can agree how they should be represented in
a decent way.
Maybe board files were much better than this frigging DT crap.
--
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
^ permalink raw reply
* Re: [PATCH v5 1/2] video: ARM CLCD: Add DT support
From: Pawel Moll @ 2014-03-13 13:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <531DAEB9.3020502@ti.com>
On Mon, 2014-03-10 at 12:23 +0000, Tomi Valkeinen wrote:
> The DT describes the hardware, and there should be only one description
> of it, no matter what the used SW is. I see compatible = "arm,pl111" in
> the dts. PL111 is the LCD controller, right?
Correct.
> What will the DRM driver
> use, then,
Exactly the same properties, plus (hopefully) the generic display data,
when (if) ready.
> if the "arm,pl111" DT data is designed to work only for the
> fbdev?
The binding I proposed is *not* designed to work only with the fbdev
driver, no. That's what I was trying to say all way long, if I failed -
apologies.
So let me say it again: with the exception display timings subnode, all
other properties will be important for the DRM scan out driver as well.
As to the display timings, being optional can be easily marked as
deprecated and replaced with the proper solution.
Now, if you find any other property I proposed being non generic enough
(ie. fbdev-specific), I will happily discuss it. Once you get generic
display bindings in place, I will gladly do all that will be required to
make CLCD driver(s) use them. But I will rather drop and forget this
patch completely that get dragged into another
"display/video/CDF/DRM/whatever" discussion. Hope I made myself clear.
Pawel
^ permalink raw reply
* [PATCH] backlight: lm3639: use devm_backlight_device_register()
From: Daniel Jeong @ 2014-03-14 2:14 UTC (permalink / raw)
To: Jingoo Han
Cc: Daniel Jeong, linux-fbdev, linux-kernel,
Jean-Christophe Plagniol-Villard, Tomi Valkeinen, Bryan Wu,
Lee Jones
change to use devm_backlight_device_register() for simple cleanup.
Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
---
drivers/video/backlight/lm3639_bl.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c
index 6fd60ad..5f36808 100644
--- a/drivers/video/backlight/lm3639_bl.c
+++ b/drivers/video/backlight/lm3639_bl.c
@@ -349,8 +349,9 @@ static int lm3639_probe(struct i2c_client *client,
props.brightness = pdata->init_brt_led;
props.max_brightness = pdata->max_brt_led;
pchip->bled - backlight_device_register("lm3639_bled", pchip->dev, pchip,
- &lm3639_bled_ops, &props);
+ devm_backlight_device_register(pchip->dev, "lm3639_bled",
+ pchip->dev, pchip, &lm3639_bled_ops,
+ &props);
if (IS_ERR(pchip->bled)) {
dev_err(&client->dev, "fail : backlight register\n");
ret = PTR_ERR(pchip->bled);
@@ -360,7 +361,7 @@ static int lm3639_probe(struct i2c_client *client,
ret = device_create_file(&(pchip->bled->dev), &dev_attr_bled_mode);
if (ret < 0) {
dev_err(&client->dev, "failed : add sysfs entries\n");
- goto err_bled_mode;
+ goto err_out;
}
/* flash */
@@ -391,8 +392,6 @@ err_torch:
led_classdev_unregister(&pchip->cdev_flash);
err_flash:
device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
-err_bled_mode:
- backlight_device_unregister(pchip->bled);
err_out:
return ret;
}
@@ -407,10 +406,8 @@ static int lm3639_remove(struct i2c_client *client)
led_classdev_unregister(&pchip->cdev_torch);
if (&pchip->cdev_flash)
led_classdev_unregister(&pchip->cdev_flash);
- if (pchip->bled) {
+ if (pchip->bled)
device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
- backlight_device_unregister(pchip->bled);
- }
return 0;
}
@@ -432,6 +429,6 @@ static struct i2c_driver lm3639_i2c_driver = {
module_i2c_driver(lm3639_i2c_driver);
MODULE_DESCRIPTION("Texas Instruments Backlight+Flash LED driver for LM3639");
-MODULE_AUTHOR("Daniel Jeong <daniel.jeong@ti.com>");
-MODULE_AUTHOR("G.Shark Jeong <gshark.jeong@gmail.com>");
+MODULE_AUTHOR("Daniel Jeong <gshark.jeong@gmail.com>");
+MODULE_AUTHOR("Ldd Mlp <ldd-mlp@list.ti.com>");
MODULE_LICENSE("GPL v2");
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH] backlight: lm3639: use devm_backlight_device_register()
From: Jingoo Han @ 2014-03-14 2:22 UTC (permalink / raw)
To: 'Lee Jones', 'Bryan Wu'
Cc: 'Daniel Jeong', linux-fbdev, linux-kernel,
'Jean-Christophe Plagniol-Villard',
'Tomi Valkeinen', 'Jingoo Han'
In-Reply-To: <1394763240-10176-1-git-send-email-gshark.jeong@gmail.com>
On Friday, March 14, 2014 11:14 AM, Daniel Jeong wrote:
>
> change to use devm_backlight_device_register() for simple cleanup.
>
> Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
Acked-by: Jingoo Han <jg1.han@samsung.com>
Lee Jones,
Would you merge this patch into your backlight tree?
Best regards,
Jingoo Han
> ---
> drivers/video/backlight/lm3639_bl.c | 17 +++++++----------
> 1 file changed, 7 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c
> index 6fd60ad..5f36808 100644
> --- a/drivers/video/backlight/lm3639_bl.c
> +++ b/drivers/video/backlight/lm3639_bl.c
> @@ -349,8 +349,9 @@ static int lm3639_probe(struct i2c_client *client,
> props.brightness = pdata->init_brt_led;
> props.max_brightness = pdata->max_brt_led;
> pchip->bled > - backlight_device_register("lm3639_bled", pchip->dev, pchip,
> - &lm3639_bled_ops, &props);
> + devm_backlight_device_register(pchip->dev, "lm3639_bled",
> + pchip->dev, pchip, &lm3639_bled_ops,
> + &props);
> if (IS_ERR(pchip->bled)) {
> dev_err(&client->dev, "fail : backlight register\n");
> ret = PTR_ERR(pchip->bled);
> @@ -360,7 +361,7 @@ static int lm3639_probe(struct i2c_client *client,
> ret = device_create_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> if (ret < 0) {
> dev_err(&client->dev, "failed : add sysfs entries\n");
> - goto err_bled_mode;
> + goto err_out;
> }
>
> /* flash */
> @@ -391,8 +392,6 @@ err_torch:
> led_classdev_unregister(&pchip->cdev_flash);
> err_flash:
> device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> -err_bled_mode:
> - backlight_device_unregister(pchip->bled);
> err_out:
> return ret;
> }
> @@ -407,10 +406,8 @@ static int lm3639_remove(struct i2c_client *client)
> led_classdev_unregister(&pchip->cdev_torch);
> if (&pchip->cdev_flash)
> led_classdev_unregister(&pchip->cdev_flash);
> - if (pchip->bled) {
> + if (pchip->bled)
> device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> - backlight_device_unregister(pchip->bled);
> - }
> return 0;
> }
>
> @@ -432,6 +429,6 @@ static struct i2c_driver lm3639_i2c_driver = {
> module_i2c_driver(lm3639_i2c_driver);
>
> MODULE_DESCRIPTION("Texas Instruments Backlight+Flash LED driver for LM3639");
> -MODULE_AUTHOR("Daniel Jeong <daniel.jeong@ti.com>");
> -MODULE_AUTHOR("G.Shark Jeong <gshark.jeong@gmail.com>");
> +MODULE_AUTHOR("Daniel Jeong <gshark.jeong@gmail.com>");
> +MODULE_AUTHOR("Ldd Mlp <ldd-mlp@list.ti.com>");
> MODULE_LICENSE("GPL v2");
> --
> 1.7.9.5
^ permalink raw reply
* [PATCH v7][ 1/5] video: mx3fb: Use devm_kzalloc
From: Denis Carikli @ 2014-03-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
Replace kzalloc by devm_kzalloc and remove the kfree() calls.
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v6->v7:
- Removed the Cc from the patch, they went into
git send-email instead.
ChangeLog v5->v6:
- New patch need
---
drivers/video/fbdev/mx3fb.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 142e860..ee95de8 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -1496,7 +1496,7 @@ static int mx3fb_probe(struct platform_device *pdev)
if (!sdc_reg)
return -EINVAL;
- mx3fb = kzalloc(sizeof(*mx3fb), GFP_KERNEL);
+ mx3fb = devm_kzalloc(&pdev->dev, sizeof(*mx3fb), GFP_KERNEL);
if (!mx3fb)
return -ENOMEM;
@@ -1542,7 +1542,6 @@ ersdc0:
dmaengine_put();
iounmap(mx3fb->reg_base);
eremap:
- kfree(mx3fb);
dev_err(dev, "mx3fb: failed to register fb\n");
return ret;
}
@@ -1561,7 +1560,6 @@ static int mx3fb_remove(struct platform_device *dev)
dmaengine_put();
iounmap(mx3fb->reg_base);
- kfree(mx3fb);
return 0;
}
--
1.7.9.5
^ permalink raw reply related
* [PATCH v7][ 2/5] video: mx3fb: Add device tree suport.
From: Denis Carikli @ 2014-03-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394788369-5096-1-git-send-email-denis@eukrea.com>
This patch is based on:
838bdf7 video: mxsfb: fix broken videomode selection
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v6->v7:
- Removed the Cc from the patch, they went into
git send-email instead.
ChangeLog v5->v6:
- Shrinked the Cc list.
- de-active and pixelclk-active dt properties are
now handled in this patch to get rid of the
"fbdev: Add the lacking FB_SYNC_* for matching the DISPLAY_FLAGS_*" patch
ChangeLog v4->v5:
- Added some people in the Cc list.
- The full ipu register range is now passed to the driver,
the code and the documentation were adapted to it.
- Updated the documentation not to mention the lcd controller, the ipu was
mentioned instead.
- The ipu patch was removed from this patchset, as a consequence the mx3fb code
has been adapted not to expect the dma ipu driver to be probed trough the device tree.
ChangeLog v3->v4:
- Updated bindings.
- Updated documentation accordinly.
- Updated code accordinly.
- Fixed the lack of "ret =" in
of_property_read_string(display_np, "model", &name);
- Supressed some compilation warnings.
ChangeLog v2->v3:
- The device tree bindings were reworked in order to make it look more like the
IPUv3 bindings.
- The interface_pix_fmt property now looks like the IPUv3 one.
---
.../devicetree/bindings/video/fsl,mx3-fb.txt | 44 +++++
drivers/video/fbdev/Kconfig | 2 +
drivers/video/fbdev/mx3fb.c | 185 +++++++++++++++++---
3 files changed, 208 insertions(+), 23 deletions(-)
create mode 100644 Documentation/devicetree/bindings/video/fsl,mx3-fb.txt
diff --git a/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt b/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt
new file mode 100644
index 0000000..c0409a4
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/fsl,mx3-fb.txt
@@ -0,0 +1,44 @@
+Freescale MX3 IPU.
+=========
+
+Required properties:
+- compatible: Should be "fsl,<chip>-ipu". compatible chips include the imx31 and the
+ imx35.
+- reg: should be register base and length as documented in the datasheet.
+- clocks: Handle to the ipu_gate clock.
+- display: Phandle to a "fsl,mx3-parallel-display" compatible display node
+ which is described below.
+
+Example:
+
+ipu: ipu@53fc0000 {
+ compatible = "fsl,imx35-ipu";
+ reg = <0x53fc0000 0x4000>;
+ clocks = <&clks 55>;
+};
+
+Parallel display support
+============
+
+Required properties:
+- compatible: Should be "fsl,mx3-parallel-display".
+- model : The user-visible name of the display.
+
+Optional properties:
+- interface_pix_fmt: How this display is connected to the
+ crtc. Currently supported types: "rgb24", "rgb565", "rgb666".
+
+It can also have an optional timing subnode as described in
+ Documentation/devicetree/bindings/video/display-timing.txt.
+
+Example:
+
+display0: display@di0 {
+ compatible = "fsl,mx3-parallel-display";
+ interface-pix-fmt = "rgb666";
+ model = "CMO-QVGA";
+};
+
+&ipu {
+ display = <&display0>;
+}
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 67409e0..c996b96 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -2330,6 +2330,8 @@ config FB_MX3
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
+ select VIDEOMODE_HELPERS
+ select FB_MODE_HELPERS
default y
help
This is a framebuffer device for the i.MX31 LCD Controller. So
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index ee95de8..952d2b5 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -31,6 +31,10 @@
#include <linux/platform_data/dma-imx.h>
#include <linux/platform_data/video-mx3fb.h>
+#include <video/of_display_timing.h>
+#include <video/of_videomode.h>
+#include <video/videomode.h>
+
#include <asm/io.h>
#include <asm/uaccess.h>
@@ -237,6 +241,8 @@ static const struct fb_videomode mx3fb_modedb[] = {
struct mx3fb_data {
struct fb_info *fbi;
+ struct videomode *vm;
+ struct fb_videomode *fb_vm;
int backlight_level;
void __iomem *reg_base;
spinlock_t lock;
@@ -269,6 +275,7 @@ struct mx3fb_info {
struct scatterlist sg[2];
struct fb_var_screeninfo cur_var; /* current var info */
+ uint32_t flags;
};
static void mx3fb_dma_done(void *);
@@ -753,16 +760,32 @@ static int __set_par(struct fb_info *fbi, bool lock)
if (mx3_fbi->ipu_ch = IDMAC_SDC_0) {
memset(&sig_cfg, 0, sizeof(sig_cfg));
+
if (fbi->var.sync & FB_SYNC_HOR_HIGH_ACT)
sig_cfg.Hsync_pol = true;
+
if (fbi->var.sync & FB_SYNC_VERT_HIGH_ACT)
sig_cfg.Vsync_pol = true;
- if (fbi->var.sync & FB_SYNC_CLK_INVERT)
- sig_cfg.clk_pol = true;
+
+ if (fbi->device->of_node) {
+ if (mx3_fbi->flags & FB_SYNC_CLK_INVERT)
+ sig_cfg.clk_pol = true;
+ } else {
+ if (fbi->var.sync & FB_SYNC_CLK_INVERT)
+ sig_cfg.clk_pol = true;
+ }
+
if (fbi->var.sync & FB_SYNC_DATA_INVERT)
sig_cfg.data_pol = true;
- if (fbi->var.sync & FB_SYNC_OE_ACT_HIGH)
- sig_cfg.enable_pol = true;
+
+ if (fbi->device->of_node) {
+ if (mx3_fbi->flags & FB_SYNC_OE_ACT_HIGH)
+ sig_cfg.enable_pol = true;
+ } else {
+ if (fbi->var.sync & FB_SYNC_OE_ACT_HIGH)
+ sig_cfg.enable_pol = true;
+ }
+
if (fbi->var.sync & FB_SYNC_CLK_IDLE_EN)
sig_cfg.clkidle_en = true;
if (fbi->var.sync & FB_SYNC_CLK_SEL_EN)
@@ -1266,7 +1289,8 @@ static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
&addr, GFP_DMA | GFP_KERNEL);
if (!fbi->screen_base) {
- dev_err(fbi->device, "Cannot allocate %u bytes framebuffer memory\n",
+ dev_err(fbi->device,
+ "Cannot allocate %u bytes framebuffer memory\n",
mem_len);
retval = -EBUSY;
goto err0;
@@ -1280,7 +1304,8 @@ static int mx3fb_map_video_memory(struct fb_info *fbi, unsigned int mem_len,
mutex_unlock(&fbi->mm_lock);
dev_dbg(fbi->device, "allocated fb @ p=0x%08x, v=0x%p, size=%d.\n",
- (uint32_t) fbi->fix.smem_start, fbi->screen_base, fbi->fix.smem_len);
+ (uint32_t) fbi->fix.smem_start,
+ fbi->screen_base, fbi->fix.smem_len);
fbi->screen_size = fbi->fix.smem_len;
@@ -1351,21 +1376,68 @@ static struct fb_info *mx3fb_init_fbinfo(struct device *dev, struct fb_ops *ops)
return fbi;
}
+static int match_dt_disp_data(const char *property)
+{
+ if (!strcmp("rgb666", property))
+ return IPU_DISP_DATA_MAPPING_RGB666;
+ else if (!strcmp("rgb565", property))
+ return IPU_DISP_DATA_MAPPING_RGB565;
+ else if (!strcmp("rgb24", property))
+ return IPU_DISP_DATA_MAPPING_RGB888;
+ else
+ return -EINVAL;
+}
+
static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
{
struct device *dev = mx3fb->dev;
struct mx3fb_platform_data *mx3fb_pdata = dev_get_platdata(dev);
- const char *name = mx3fb_pdata->name;
+ struct device_node *np = dev->of_node;
+ const char *name;
+ const char *ipu_disp_format;
unsigned int irq;
struct fb_info *fbi;
struct mx3fb_info *mx3fbi;
const struct fb_videomode *mode;
int ret, num_modes;
+ struct device_node *display_np = NULL;
+
+ if (np) {
+ display_np = of_parse_phandle(np, "display", 0);
+ if (!display_np) {
+ dev_err(dev, "Can't get the display device node.\n");
+ return -EINVAL;
+ }
+
+ of_property_read_string(display_np, "interface-pix-fmt",
+ &ipu_disp_format);
+ if (!ipu_disp_format) {
+ mx3fb->disp_data_fmt = IPU_DISP_DATA_MAPPING_RGB666;
+ dev_warn(dev,
+ "ipu display data mapping was not defined, using the default rgb666.\n");
+ } else {
+ mx3fb->disp_data_fmt + match_dt_disp_data(ipu_disp_format);
+ }
- if (mx3fb_pdata->disp_data_fmt >= ARRAY_SIZE(di_mappings)) {
- dev_err(dev, "Illegal display data format %d\n",
+ if (mx3fb->disp_data_fmt = -EINVAL) {
+ dev_err(dev, "Illegal display data format \"%s\"\n",
+ ipu_disp_format);
+ return -EINVAL;
+ }
+
+ ret = of_property_read_string(display_np, "model", &name);
+ if (ret) {
+ dev_err(dev, "Missing display model name\n");
+ return -EINVAL;
+ }
+ } else {
+ name = mx3fb_pdata->name;
+ if (mx3fb_pdata->disp_data_fmt >= ARRAY_SIZE(di_mappings)) {
+ dev_err(dev, "Illegal display data format %d\n",
mx3fb_pdata->disp_data_fmt);
- return -EINVAL;
+ return -EINVAL;
+ }
}
ichan->client = mx3fb;
@@ -1386,12 +1458,36 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
goto emode;
}
- if (mx3fb_pdata->mode && mx3fb_pdata->num_modes) {
- mode = mx3fb_pdata->mode;
- num_modes = mx3fb_pdata->num_modes;
+ mx3fbi = fbi->par;
+
+ if (np) {
+ ret = of_get_videomode(display_np, mx3fb->vm,
+ OF_USE_NATIVE_MODE);
+ if (ret) {
+ dev_err(dev, "failed to get videomode from DT\n");
+ goto put_display_node;
+ }
+
+ ret = fb_videomode_from_videomode(mx3fb->vm, mx3fb->fb_vm);
+ if (ret < 0)
+ goto put_display_node;
+
+ if (mx3fb->vm->flags & DISPLAY_FLAGS_DE_HIGH)
+ mx3fbi->flags |= FB_SYNC_OE_ACT_HIGH;
+
+ if (mx3fb->vm->flags & DISPLAY_FLAGS_PIXDATA_NEGEDGE)
+ mx3fbi->flags |= FB_SYNC_CLK_INVERT;
+
+ mode = mx3fb->fb_vm;
+ num_modes = 1;
} else {
- mode = mx3fb_modedb;
- num_modes = ARRAY_SIZE(mx3fb_modedb);
+ if (mx3fb_pdata->mode && mx3fb_pdata->num_modes) {
+ mode = mx3fb_pdata->mode;
+ num_modes = mx3fb_pdata->num_modes;
+ } else {
+ mode = mx3fb_modedb;
+ num_modes = ARRAY_SIZE(mx3fb_modedb);
+ }
}
if (!fb_find_mode(&fbi->var, fbi, fb_mode, mode,
@@ -1415,13 +1511,13 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
sdc_set_global_alpha(mx3fb, true, 0xFF);
sdc_set_color_key(mx3fb, IDMAC_SDC_0, false, 0);
- mx3fbi = fbi->par;
mx3fbi->idmac_channel = ichan;
mx3fbi->ipu_ch = ichan->dma_chan.chan_id;
mx3fbi->mx3fb = mx3fb;
mx3fbi->blank = FB_BLANK_NORMAL;
- mx3fb->disp_data_fmt = mx3fb_pdata->disp_data_fmt;
+ if (!np)
+ mx3fb->disp_data_fmt = mx3fb_pdata->disp_data_fmt;
init_completion(&mx3fbi->flip_cmpl);
disable_irq(ichan->eof_irq);
@@ -1440,6 +1536,8 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
return 0;
+put_display_node:
+ of_node_put(display_np);
erfb:
esetpar:
emode:
@@ -1455,17 +1553,21 @@ static bool chan_filter(struct dma_chan *chan, void *arg)
struct device *dev;
struct mx3fb_platform_data *mx3fb_pdata;
- if (!imx_dma_is_ipu(chan))
- return false;
-
if (!rq)
return false;
dev = rq->mx3fb->dev;
mx3fb_pdata = dev_get_platdata(dev);
- return rq->id = chan->chan_id &&
- mx3fb_pdata->dma_dev = chan->device->dev;
+ if (!imx_dma_is_ipu(chan) && mx3fb_pdata)
+ return false;
+
+ /* When using the devicetree, mx3fb_pdata is NULL */
+ if (mx3fb_pdata)
+ return rq->id = chan->chan_id &&
+ mx3fb_pdata->dma_dev = chan->device->dev;
+ else
+ return rq->id = chan->chan_id;
}
static void release_fbi(struct fb_info *fbi)
@@ -1487,6 +1589,9 @@ static int mx3fb_probe(struct platform_device *pdev)
dma_cap_mask_t mask;
struct dma_chan *chan;
struct dma_chan_request rq;
+ struct device_node *np = dev->of_node;
+ struct videomode *vm;
+ struct fb_videomode *fb_vm;
/*
* Display Interface (DI) and Synchronous Display Controller (SDC)
@@ -1508,7 +1613,33 @@ static int mx3fb_probe(struct platform_device *pdev)
goto eremap;
}
- pr_debug("Remapped %pR at %p\n", sdc_reg, mx3fb->reg_base);
+ /* The full IPU registers range is passed by the device tree,
+ * whereas the platform data only passes the SDC registers range.
+ */
+ if (np) {
+ vm = devm_kzalloc(&pdev->dev, sizeof(struct videomode),
+ GFP_KERNEL);
+ if (!vm) {
+ ret = -ENOMEM;
+ goto eremap;
+ }
+
+ fb_vm = devm_kzalloc(&pdev->dev, sizeof(struct fb_videomode),
+ GFP_KERNEL);
+ if (!fb_vm) {
+ ret = -ENOMEM;
+ goto eremap;
+ }
+
+ mx3fb->vm = vm;
+ mx3fb->fb_vm = fb_vm;
+
+ mx3fb->reg_base += MX3FB_REG_OFFSET;
+ pr_debug("Remapped %pR at %p\n", sdc_reg + MX3FB_REG_OFFSET,
+ mx3fb->reg_base);
+ } else {
+ pr_debug("Remapped %pR at %p\n", sdc_reg, mx3fb->reg_base);
+ }
/* IDMAC interface */
dmaengine_get();
@@ -1563,9 +1694,17 @@ static int mx3fb_remove(struct platform_device *dev)
return 0;
}
+static struct of_device_id mx3fb_of_dev_id[] = {
+ { .compatible = "fsl,imx31-ipu", },
+ { .compatible = "fsl,imx35-ipu", },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, mx3fb_of_dev_id);
+
static struct platform_driver mx3fb_driver = {
.driver = {
.name = MX3FB_NAME,
+ .of_match_table = mx3fb_of_dev_id,
.owner = THIS_MODULE,
},
.probe = mx3fb_probe,
--
1.7.9.5
^ permalink raw reply related
* [PATCH v7][ 3/5] video: mx3fb: Introduce regulator support.
From: Denis Carikli @ 2014-03-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394788369-5096-1-git-send-email-denis@eukrea.com>
This commit is based on the following commit by Fabio Estevam:
4344429 video: mxsfb: Introduce regulator support
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v6->v7:
- Removed the Cc from the patch, they went into
git send-email instead.
ChangeLog v5->v6:
- Shrinked the Cc list.
- still permit non-dt boards to use that driver without a regulator.
ChangeLog v4->v5:
- Added Shawn Guo in the Cc list.
- Rebased to make it apply.
ChangeLog v3->v4:
- Some code style fixes.
- Improved error handling in eremap.
ChangeLog v2->v3:
- The prints are now replaced with non line wrapped prints.
- The regulator retrival has been adapted to the new DT bindings which looks
more like the IPUv3 ones.
- The regulator_is_enabled checks were kept, because regulator_disable do not
do such check.
---
drivers/video/mx3fb.c | 56 ++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 55 insertions(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/mx3fb.c b/drivers/video/fbdev/mx3fb.c
index 952d2b5..40b47dd 100644
--- a/drivers/video/fbdev/mx3fb.c
+++ b/drivers/video/fbdev/mx3fb.c
@@ -27,6 +27,7 @@
#include <linux/clk.h>
#include <linux/mutex.h>
#include <linux/dma/ipu-dma.h>
+#include <linux/regulator/consumer.h>
#include <linux/platform_data/dma-imx.h>
#include <linux/platform_data/video-mx3fb.h>
@@ -273,6 +274,7 @@ struct mx3fb_info {
struct dma_async_tx_descriptor *txd;
dma_cookie_t cookie;
struct scatterlist sg[2];
+ struct regulator *reg_lcd;
struct fb_var_screeninfo cur_var; /* current var info */
uint32_t flags;
@@ -1042,6 +1044,12 @@ static void __blank(int blank, struct fb_info *fbi)
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_NORMAL:
sdc_set_brightness(mx3fb, 0);
+ if (!IS_ERR(mx3_fbi->reg_lcd)) {
+ if (regulator_disable(mx3_fbi->reg_lcd)) {
+ dev_err(fbi->device,
+ "Failed to disable regulator.\n");
+ }
+ }
memset((char *)fbi->screen_base, 0, fbi->fix.smem_len);
/* Give LCD time to update - enough for 50 and 60 Hz */
msleep(25);
@@ -1049,6 +1057,12 @@ static void __blank(int blank, struct fb_info *fbi)
break;
case FB_BLANK_UNBLANK:
sdc_enable_channel(mx3_fbi);
+ if (!IS_ERR(mx3_fbi->reg_lcd)) {
+ if (regulator_enable(mx3_fbi->reg_lcd)) {
+ dev_err(fbi->device,
+ "Failed to enable regulator.\n");
+ }
+ }
sdc_set_brightness(mx3fb, mx3fb->backlight_level);
break;
}
@@ -1233,7 +1247,12 @@ static int mx3fb_suspend(struct platform_device *pdev, pm_message_t state)
if (mx3_fbi->blank = FB_BLANK_UNBLANK) {
sdc_disable_channel(mx3_fbi);
sdc_set_brightness(mx3fb, 0);
-
+ if (!IS_ERR(mx3_fbi->reg_lcd)) {
+ if (regulator_disable(mx3_fbi->reg_lcd)) {
+ dev_err(&pdev->dev,
+ "Failed to disable regulator.\n");
+ }
+ }
}
return 0;
}
@@ -1249,6 +1268,12 @@ static int mx3fb_resume(struct platform_device *pdev)
if (mx3_fbi->blank = FB_BLANK_UNBLANK) {
sdc_enable_channel(mx3_fbi);
sdc_set_brightness(mx3fb, mx3fb->backlight_level);
+ if (!IS_ERR(mx3_fbi->reg_lcd)) {
+ if (regulator_enable(mx3_fbi->reg_lcd)) {
+ dev_err(&pdev->dev,
+ "Failed to enable regulator.\n");
+ }
+ }
}
console_lock();
@@ -1394,6 +1419,7 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
struct mx3fb_platform_data *mx3fb_pdata = dev_get_platdata(dev);
struct device_node *np = dev->of_node;
const char *name;
+ const char *regulator_name;
const char *ipu_disp_format;
unsigned int irq;
struct fb_info *fbi;
@@ -1409,6 +1435,9 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
return -EINVAL;
}
+ of_property_read_string(display_np, "regulator-name",
+ ®ulator_name);
+
of_property_read_string(display_np, "interface-pix-fmt",
&ipu_disp_format);
if (!ipu_disp_format) {
@@ -1526,6 +1555,21 @@ static int init_fb_chan(struct mx3fb_data *mx3fb, struct idmac_channel *ichan)
if (ret < 0)
goto esetpar;
+ /* In dt mode,
+ * using devm_regulator_get would require that the proprety referencing
+ * the regulator phandle has to be inside the mx3fb node.
+ */
+ if (np) {
+ if (regulator_name)
+ mx3fbi->reg_lcd = regulator_get(NULL, regulator_name);
+
+ if (IS_ERR(mx3fbi->reg_lcd))
+ return PTR_ERR(mx3fbi->reg_lcd);
+ } else {
+ /* Permit that driver without a regulator in non-dt mode */
+ mx3fbi->reg_lcd = regulator_get(dev, "lcd");
+ }
+
__blank(FB_BLANK_UNBLANK, fbi);
dev_info(dev, "registered, using mode %s\n", fb_mode);
@@ -1589,6 +1633,7 @@ static int mx3fb_probe(struct platform_device *pdev)
dma_cap_mask_t mask;
struct dma_chan *chan;
struct dma_chan_request rq;
+ struct mx3fb_info *mx3_fbi;
struct device_node *np = dev->of_node;
struct videomode *vm;
struct fb_videomode *fb_vm;
@@ -1673,6 +1718,12 @@ ersdc0:
dmaengine_put();
iounmap(mx3fb->reg_base);
eremap:
+ if (mx3fb->fbi) {
+ mx3_fbi = mx3fb->fbi->par;
+
+ if ((!IS_ERR(mx3_fbi->reg_lcd)) && mx3_fbi->reg_lcd)
+ regulator_put(mx3_fbi->reg_lcd);
+ }
dev_err(dev, "mx3fb: failed to register fb\n");
return ret;
}
@@ -1684,6 +1735,9 @@ static int mx3fb_remove(struct platform_device *dev)
struct mx3fb_info *mx3_fbi = fbi->par;
struct dma_chan *chan;
+ if ((!IS_ERR(mx3_fbi->reg_lcd)) && mx3_fbi->reg_lcd)
+ regulator_put(mx3_fbi->reg_lcd);
+
chan = &mx3_fbi->idmac_channel->dma_chan;
release_fbi(fbi);
--
1.7.9.5
^ permalink raw reply related
* [PATCH v7][ 4/5] ARM: dts: i.MX35: Add display support.
From: Denis Carikli @ 2014-03-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394788369-5096-1-git-send-email-denis@eukrea.com>
There is already a "dma ipu driver" for the mx3*
that is currently at drivers/dma/ipu/ipu_idmac.c
The mx3fb framebuffer driver uses this "dma ipu driver".
The goal is not to expose the "dma ipu driver" in the device
tree bindings, to make the mx3fb bindings look similar
to the ipuv3 ones.
In the device tree bindings, the "dma ipu driver" is absent,
and the mx3fb compatible is "fsl,imx<soc>-ipu".
An node for the mx3fb was also added in the imx35 dtsi.
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v6->v7:
- Removed the Cc from the patch, they went into
git send-email instead.
- Removed the comment, and instead a commit messaage was
added to explain the non-straingtforward part of the change.
ChangeLog v5->v6:
- Shrinked the Cc list.
ChangeLog v4->v5:
- Added Grant Likely and Shawn Guo in the Cc list.
- Adapted to the new non-dma ipu bindings.
- Adapted to the use of imx35-pingrp.h
- The pinctrl ipu node addition was moved in this commit.
ChangeLog v3->v4:
- Splitted the imx35.dtsi display support (new patch).
---
arch/arm/boot/dts/imx35.dtsi | 7 +++++++
arch/arm/mach-imx/imx35-dt.c | 6 ++++++
2 files changed, 13 insertions(+)
diff --git a/arch/arm/boot/dts/imx35.dtsi b/arch/arm/boot/dts/imx35.dtsi
index e59ccb4..b9bf6a0 100644
--- a/arch/arm/boot/dts/imx35.dtsi
+++ b/arch/arm/boot/dts/imx35.dtsi
@@ -230,6 +230,13 @@
status = "disabled";
};
+ ipu: ipu@53fc0000 {
+ compatible = "fsl,imx35-ipu";
+ reg = <0x53fc0000 0x4000>;
+ clocks = <&clks 55>;
+ status = "disabled";
+ };
+
audmux: audmux@53fc4000 {
compatible = "fsl,imx35-audmux", "fsl,imx31-audmux";
reg = <0x53fc4000 0x4000>;
diff --git a/arch/arm/mach-imx/imx35-dt.c b/arch/arm/mach-imx/imx35-dt.c
index 9d48e00..657cc5d 100644
--- a/arch/arm/mach-imx/imx35-dt.c
+++ b/arch/arm/mach-imx/imx35-dt.c
@@ -18,14 +18,20 @@
#include <asm/mach/time.h>
#include <asm/hardware/cache-l2x0.h>
#include "common.h"
+#include "devices-imx35.h"
#include "mx35.h"
static void __init imx35_dt_init(void)
{
+ struct device_node *np;
mxc_arch_reset_init_dt();
of_platform_populate(NULL, of_default_bus_match_table,
NULL, NULL);
+
+ np = of_find_compatible_node(NULL, NULL, "fsl,imx35-ipu");
+ if (of_device_is_available(np))
+ imx35_add_ipu_core();
}
static void __init imx35_irq_init(void)
--
1.7.9.5
^ permalink raw reply related
* =?UTF-8?q?=5BPATCH=20v7=5D=5B=205/5=5D=20ARM=3A=20dts=3A=20mbimxsd35=20Add=20video=20and=20displays=
From: Denis Carikli @ 2014-03-14 9:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394788369-5096-1-git-send-email-denis@eukrea.com>
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v6->v7:
- Removed the Cc from the patch, they went into
git send-email instead.
ChangeLog v5->v6:
- Shrinked the Cc list.
- Added the targets in the Makefile
- rebased not to use the now gone pingrp headers.
ChangeLog v4->v5:
- Added Grant Likely and Shawn Guo in the Cc list.
- Adapted to the new non-dma ipu bindings.
ChangeLog v3->v4:
- Shortened the licenses.
- adapted the dts(i) to the new bindings.
ChangeLog v2->v3:
- The dts were adapted to the new DT bindings which looks more like the IPUv3
ones.
---
arch/arm/boot/dts/Makefile | 3 +
arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi | 28 ++++++++++
.../imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dts | 58 ++++++++++++++++++++
.../imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dts | 47 ++++++++++++++++
.../imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dts | 47 ++++++++++++++++
5 files changed, 183 insertions(+)
create mode 100644 arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dts
create mode 100644 arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dts
create mode 100644 arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dts
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
index cf6c523..1df8945 100644
--- a/arch/arm/boot/dts/Makefile
+++ b/arch/arm/boot/dts/Makefile
@@ -173,6 +173,9 @@ dtb-$(CONFIG_ARCH_MXC) += \
imx27-phytec-phycard-s-rdk.dtb \
imx31-bug.dtb \
imx35-eukrea-mbimxsd35-baseboard.dtb \
+ imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dtb \
+ imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dtb \
+ imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dtb \
imx50-evk.dtb \
imx51-apf51.dtb \
imx51-apf51dev.dtb \
diff --git a/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
index 906ae93..6596009 100644
--- a/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
+++ b/arch/arm/boot/dts/imx35-eukrea-cpuimx35.dtsi
@@ -70,6 +70,34 @@
MX35_PAD_I2C1_DAT__I2C1_SDA 0x80000000
>;
};
+
+ pinctrl_ipu_disp0: ipudisp0grp {
+ fsl,pins = <
+ MX35_PAD_LD0__IPU_DISPB_DAT_0 0x80000000
+ MX35_PAD_LD1__IPU_DISPB_DAT_1 0x80000000
+ MX35_PAD_LD2__IPU_DISPB_DAT_2 0x80000000
+ MX35_PAD_LD3__IPU_DISPB_DAT_3 0x80000000
+ MX35_PAD_LD4__IPU_DISPB_DAT_4 0x80000000
+ MX35_PAD_LD5__IPU_DISPB_DAT_5 0x80000000
+ MX35_PAD_LD6__IPU_DISPB_DAT_6 0x80000000
+ MX35_PAD_LD7__IPU_DISPB_DAT_7 0x80000000
+ MX35_PAD_LD8__IPU_DISPB_DAT_8 0x80000000
+ MX35_PAD_LD9__IPU_DISPB_DAT_9 0x80000000
+ MX35_PAD_LD10__IPU_DISPB_DAT_10 0x80000000
+ MX35_PAD_LD11__IPU_DISPB_DAT_11 0x80000000
+ MX35_PAD_LD12__IPU_DISPB_DAT_12 0x80000000
+ MX35_PAD_LD13__IPU_DISPB_DAT_13 0x80000000
+ MX35_PAD_LD14__IPU_DISPB_DAT_14 0x80000000
+ MX35_PAD_LD15__IPU_DISPB_DAT_15 0x80000000
+ MX35_PAD_LD16__IPU_DISPB_DAT_16 0x80000000
+ MX35_PAD_LD17__IPU_DISPB_DAT_17 0x80000000
+ MX35_PAD_D3_HSYNC__IPU_DISPB_D3_HSYNC 0x80000000
+ MX35_PAD_D3_FPSHIFT__IPU_DISPB_D3_CLK 0x80000000
+ MX35_PAD_D3_DRDY__IPU_DISPB_D3_DRDY 0x80000000
+ MX35_PAD_D3_VSYNC__IPU_DISPB_D3_VSYNC 0x80000000
+ MX35_PAD_CONTRAST__IPU_DISPB_CONTR 0x80000000
+ >;
+ };
};
};
diff --git a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dts b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dts
new file mode 100644
index 0000000..345f560
--- /dev/null
+++ b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-cmo-qvga.dts
@@ -0,0 +1,58 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx35-eukrea-mbimxsd35-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD35 with the CMO-QVGA Display";
+ compatible = "eukrea,mbimxsd35-baseboard-cmo-qvga", "eukrea,mbimxsd35-baseboard", "eukrea,cpuimx35", "fsl,imx35";
+
+ cmo_qvga: display@di0 {
+ compatible = "fsl,mx3-parallel-display";
+ regulator-name = "lcd";
+ interface-pix-fmt = "rgb666";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ipu_disp0>;
+ lcd-supply = <®_lcd_3v3>;
+ model = "CMO-QVGA";
+ display-timings {
+ qvga_timings: 320x240 {
+ clock-frequency = <6500000>;
+ hactive = <320>;
+ vactive = <240>;
+ hback-porch = <68>;
+ hfront-porch = <20>;
+ vback-porch = <15>;
+ vfront-porch = <4>;
+ hsync-len = <30>;
+ vsync-len = <3>;
+ };
+ };
+ };
+
+ reg_lcd_3v3: lcd-en {
+ compatible = "regulator-fixed";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_reg_lcd_3v3>;
+ regulator-name = "lcd";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio1 4 0>;
+ enable-active-high;
+ };
+};
+
+&ipu {
+ display = <&cmo_qvga>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dts b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dts
new file mode 100644
index 0000000..1a249d0
--- /dev/null
+++ b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-svga.dts
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx35-eukrea-mbimxsd35-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD35 with the DVI-SVGA Display";
+ compatible = "eukrea,mbimxsd35-baseboard-dvi-svga", "eukrea,mbimxsd35-baseboard", "eukrea,cpuimx35", "fsl,imx35";
+ dvi_svga: display@di0 {
+ interface-pix-fmt = "rgb666";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ipu_disp0>;
+ model = "DVI-SVGA";
+ display-timings {
+ svga_timings: 800x600 {
+ clock-frequency = <40000000>;
+ hactive = <800>;
+ vactive = <600>;
+ hback-porch = <75>;
+ hfront-porch = <75>;
+ vback-porch = <7>;
+ vfront-porch = <75>;
+ hsync-len = <7>;
+ vsync-len = <7>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ de-active = <1>;
+ pixelclk-active = <0>;
+ };
+ };
+ };
+};
+
+&ipu {
+ display = <&dvi_svga>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dts b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dts
new file mode 100644
index 0000000..44a7616
--- /dev/null
+++ b/arch/arm/boot/dts/imx35-eukrea-mbimxsd35-baseboard-dvi-vga.dts
@@ -0,0 +1,47 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx35-eukrea-mbimxsd35-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD35 with the DVI-VGA Display";
+ compatible = "eukrea,mbimxsd35-baseboard-dvi-vga", "eukrea,mbimxsd35-baseboard", "eukrea,cpuimx35", "fsl,imx35";
+ dvi_vga: display@di0 {
+ interface-pix-fmt = "rgb666";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_ipu_disp0>;
+ model = "DVI-VGA";
+ display-timings {
+ vga_timings: 640x480 {
+ clock-frequency = <31250000>;
+ hactive = <640>;
+ vactive = <480>;
+ hback-porch = <100>;
+ hfront-porch = <100>;
+ vback-porch = <7>;
+ vfront-porch = <100>;
+ hsync-len = <7>;
+ vsync-len = <7>;
+ hsync-active = <1>;
+ vsync-active = <1>;
+ de-active = <1>;
+ pixelclk-active = <0>;
+ };
+ };
+ };
+};
+
+&ipu {
+ display = <&dvi_vga>;
+ status = "okay";
+};
--
1.7.9.5
^ permalink raw reply related
* Re: [PATCH v7][ 3/5] video: mx3fb: Introduce =?UTF-8?B?cmVndWxhdG9yIHN1c
From: Alexander Shiyan @ 2014-03-14 9:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394788369-5096-3-git-send-email-denis@eukrea.com>
0J/Rj9GC0L3QuNGG0LAsIDE0INC80LDRgNGC0LAgMjAxNCwgMTA6MTIgKzAxOjAwINC+0YIgRGVu
aXMgQ2FyaWtsaSA8ZGVuaXNAZXVrcmVhLmNvbT46Cj4gVGhpcyBjb21taXQgaXMgYmFzZWQgb24g
dGhlIGZvbGxvd2luZyBjb21taXQgYnkgRmFiaW8gRXN0ZXZhbToKPiAgIDQzNDQ0MjkgdmlkZW86
IG14c2ZiOiBJbnRyb2R1Y2UgcmVndWxhdG9yIHN1cHBvcnQKPiAKPiBTaWduZWQtb2ZmLWJ5OiBE
ZW5pcyBDYXJpa2xpIDxkZW5pc0BldWtyZWEuY29tPgo+IC0tLQouLi4KPiArCWlmIChucCkgewo+
ICsJCWlmIChyZWd1bGF0b3JfbmFtZSkKPiArCQkJbXgzZmJpLT5yZWdfbGNkID0gcmVndWxhdG9y
X2dldChOVUxMLCByZWd1bGF0b3JfbmFtZSk7Cj4gKwo+ICsJCWlmIChJU19FUlIobXgzZmJpLT5y
ZWdfbGNkKSkKPiArCQkJcmV0dXJuIFBUUl9FUlIobXgzZmJpLT5yZWdfbGNkKTsKPiArCX0gZWxz
ZSB7Cj4gKwkJLyogUGVybWl0IHRoYXQgZHJpdmVyIHdpdGhvdXQgYSByZWd1bGF0b3IgaW4gbm9u
LWR0IG1vZGUgKi8KPiArCQlteDNmYmktPnJlZ19sY2QgPSByZWd1bGF0b3JfZ2V0KGRldiwgImxj
ZCIpOwo+ICsJfQoKSSBhbSBzdGlsbCBjb21wbGV0ZWx5IGRvIG5vdCB1bmRlcnN0YW5kIHdoeSBk
byB5b3UgbmVlZCB0byBoYXZlCiJyZWd1bGF0b3JfbmFtZSIgcHJvcGVydHk/CldoeSB0aGlzIGNh
bm5vdCBiZSBkZXZtX3JlZ3VsYXRvcl9nZXQoZGV2LCAibGNkIikgaW4gYm90aCBEVCBhbmQgbm9u
LURUIGNhc2U/CgotLS0K
^ permalink raw reply
* [PATCH] video: lcd: Remove useless BACKLIGHT_LCD_SUPPORT kernel symbol
From: Alexander Shiyan @ 2014-03-14 10:41 UTC (permalink / raw)
To: linux-fbdev
Symbol BACKLIGHT_LCD_SUPPORT affecting anything, except enabling
the backlight & LCD Kconfig menu. Patch removes this symbol as useless.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
arch/unicore32/Kconfig | 1 -
drivers/gpu/drm/i915/Kconfig | 1 -
drivers/gpu/drm/nouveau/Kconfig | 1 -
drivers/gpu/drm/tilcdc/Kconfig | 1 -
drivers/platform/x86/Kconfig | 1 -
drivers/usb/misc/Kconfig | 1 -
drivers/video/backlight/Kconfig | 39 +++++++++++++--------------------------
drivers/video/fbdev/Kconfig | 1 -
8 files changed, 13 insertions(+), 33 deletions(-)
diff --git a/arch/unicore32/Kconfig b/arch/unicore32/Kconfig
index 25c0dba..ccb3f01 100644
--- a/arch/unicore32/Kconfig
+++ b/arch/unicore32/Kconfig
@@ -237,7 +237,6 @@ config I2C_EEPROM_AT24
config LCD_BACKLIGHT
tristate "LCD Backlight support"
- select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_PWM
endmenu
diff --git a/drivers/gpu/drm/i915/Kconfig b/drivers/gpu/drm/i915/Kconfig
index 73ed59e..cd4b3c0 100644
--- a/drivers/gpu/drm/i915/Kconfig
+++ b/drivers/gpu/drm/i915/Kconfig
@@ -12,7 +12,6 @@ config DRM_I915
select DRM_KMS_HELPER
# i915 depends on ACPI_VIDEO when ACPI is enabled
# but for select to work, need to select ACPI_VIDEO's dependencies, ick
- select BACKLIGHT_LCD_SUPPORT if ACPI
select BACKLIGHT_CLASS_DEVICE if ACPI
select VIDEO_OUTPUT_CONTROL if ACPI
select INPUT if ACPI
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 7cf787d..c6f04e2 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -17,7 +17,6 @@ config DRM_NOUVEAU
select MXM_WMI if ACPI && X86
select POWER_SUPPLY
# Similar to i915, we need to select ACPI_VIDEO and it's dependencies
- select BACKLIGHT_LCD_SUPPORT if ACPI && X86
select BACKLIGHT_CLASS_DEVICE if ACPI && X86
select VIDEO_OUTPUT_CONTROL if ACPI && X86
select INPUT if ACPI && X86
diff --git a/drivers/gpu/drm/tilcdc/Kconfig b/drivers/gpu/drm/tilcdc/Kconfig
index 7c3ef79..fb5f1c6 100644
--- a/drivers/gpu/drm/tilcdc/Kconfig
+++ b/drivers/gpu/drm/tilcdc/Kconfig
@@ -7,7 +7,6 @@ config DRM_TILCDC
select DRM_GEM_CMA_HELPER
select VIDEOMODE_HELPERS
select BACKLIGHT_CLASS_DEVICE
- select BACKLIGHT_LCD_SUPPORT
help
Choose this option if you have an TI SoC with LCDC display
controller, for example AM33xx in beagle-bone, DA8xx, or
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 5ae65c1..f1dc7ae 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -311,7 +311,6 @@ config THINKPAD_ACPI
depends on ACPI
depends on INPUT
depends on RFKILL || RFKILL = n
- select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE
select HWMON
select NVRAM
diff --git a/drivers/usb/misc/Kconfig b/drivers/usb/misc/Kconfig
index 1bca274..3bc6333 100644
--- a/drivers/usb/misc/Kconfig
+++ b/drivers/usb/misc/Kconfig
@@ -150,7 +150,6 @@ config USB_FTDI_ELAN
config USB_APPLEDISPLAY
tristate "Apple Cinema Display support"
- select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE
help
Say Y here if you want to control the backlight of Apple Cinema
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index 5a3eb2e..6c37268 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -2,20 +2,13 @@
# Backlight & LCD drivers configuration
#
-menuconfig BACKLIGHT_LCD_SUPPORT
- bool "Backlight & LCD device support"
- help
- Enable this to be able to choose the drivers for controlling the
- backlight and the LCD panel on some platforms, for example on PDAs.
-
-if BACKLIGHT_LCD_SUPPORT
+menu "Backlight & LCD device support"
#
# LCD
#
config LCD_CLASS_DEVICE
tristate "Lowlevel LCD controls"
- default m
help
This framework adds support for low-level control of LCD.
Some framebuffer devices connect to platform-specific LCD modules
@@ -112,7 +105,6 @@ config LCD_HP700
config LCD_S6E63M0
tristate "S6E63M0 AMOLED LCD Driver"
depends on SPI && BACKLIGHT_CLASS_DEVICE
- default n
help
If you have an S6E63M0 LCD Panel, say Y to enable its
LCD control driver.
@@ -120,7 +112,6 @@ config LCD_S6E63M0
config LCD_LD9040
tristate "LD9040 AMOLED LCD Driver"
depends on SPI && BACKLIGHT_CLASS_DEVICE
- default n
help
If you have an LD9040 Panel, say Y to enable its
control driver.
@@ -128,7 +119,6 @@ config LCD_LD9040
config LCD_AMS369FG06
tristate "AMS369FG06 AMOLED LCD Driver"
depends on SPI && BACKLIGHT_CLASS_DEVICE
- default n
help
If you have an AMS369FG06 AMOLED Panel, say Y to enable its
LCD control driver.
@@ -136,7 +126,6 @@ config LCD_AMS369FG06
config LCD_LMS501KF03
tristate "LMS501KF03 LCD Driver"
depends on SPI
- default n
help
If you have an LMS501KF03 LCD Panel, say Y to enable its
LCD control driver.
@@ -155,7 +144,6 @@ endif # LCD_CLASS_DEVICE
#
config BACKLIGHT_CLASS_DEVICE
tristate "Lowlevel Backlight controls"
- default m
help
This framework adds support for low-level control of the LCD
backlight. This includes support for brightness and power.
@@ -209,7 +197,6 @@ config BACKLIGHT_GENERIC
config BACKLIGHT_LM3533
tristate "Backlight Driver for LM3533"
- depends on BACKLIGHT_CLASS_DEVICE
depends on MFD_LM3533
help
Say Y to enable the backlight driver for National Semiconductor / TI
@@ -326,7 +313,7 @@ config BACKLIGHT_ADP5520
config BACKLIGHT_ADP8860
tristate "Backlight Driver for ADP8860/ADP8861/ADP8863 using WLED"
- depends on BACKLIGHT_CLASS_DEVICE && I2C
+ depends on I2C
select NEW_LEDS
select LEDS_CLASS
help
@@ -338,7 +325,7 @@ config BACKLIGHT_ADP8860
config BACKLIGHT_ADP8870
tristate "Backlight Driver for ADP8870 using WLED"
- depends on BACKLIGHT_CLASS_DEVICE && I2C
+ depends on I2C
select NEW_LEDS
select LEDS_CLASS
help
@@ -356,28 +343,28 @@ config BACKLIGHT_88PM860X
config BACKLIGHT_PCF50633
tristate "Backlight driver for NXP PCF50633 MFD"
- depends on BACKLIGHT_CLASS_DEVICE && MFD_PCF50633
+ depends on MFD_PCF50633
help
If you have a backlight driven by a NXP PCF50633 MFD, say Y here to
enable its driver.
config BACKLIGHT_AAT2870
tristate "AnalogicTech AAT2870 Backlight"
- depends on BACKLIGHT_CLASS_DEVICE && MFD_AAT2870_CORE
+ depends on MFD_AAT2870_CORE
help
If you have a AnalogicTech AAT2870 say Y to enable the
backlight driver.
config BACKLIGHT_LM3630A
tristate "Backlight Driver for LM3630A"
- depends on BACKLIGHT_CLASS_DEVICE && I2C
+ depends on I2C
select REGMAP_I2C
help
This supports TI LM3630A Backlight Driver
config BACKLIGHT_LM3639
tristate "Backlight Driver for LM3639"
- depends on BACKLIGHT_CLASS_DEVICE && I2C
+ depends on I2C
select REGMAP_I2C
select NEW_LEDS
select LEDS_CLASS
@@ -386,20 +373,20 @@ config BACKLIGHT_LM3639
config BACKLIGHT_LP855X
tristate "Backlight driver for TI LP855X"
- depends on BACKLIGHT_CLASS_DEVICE && I2C
+ depends on I2C
help
This supports TI LP8550, LP8551, LP8552, LP8553, LP8555, LP8556 and
LP8557 backlight driver.
config BACKLIGHT_LP8788
tristate "Backlight driver for TI LP8788 MFD"
- depends on BACKLIGHT_CLASS_DEVICE && MFD_LP8788
+ depends on MFD_LP8788
help
This supports TI LP8788 backlight driver.
config BACKLIGHT_OT200
tristate "Backlight driver for ot200 visualisation device"
- depends on BACKLIGHT_CLASS_DEVICE && CS5535_MFGPT && GPIO_CS5535
+ depends on CS5535_MFGPT && GPIO_CS5535
help
To compile this driver as a module, choose M here: the module will be
called ot200_bl.
@@ -413,14 +400,14 @@ config BACKLIGHT_PANDORA
config BACKLIGHT_TPS65217
tristate "TPS65217 Backlight"
- depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217
+ depends on MFD_TPS65217
help
If you have a Texas Instruments TPS65217 say Y to enable the
backlight driver.
config BACKLIGHT_AS3711
tristate "AS3711 Backlight"
- depends on BACKLIGHT_CLASS_DEVICE && MFD_AS3711
+ depends on MFD_AS3711
help
If you have an Austrian Microsystems AS3711 say Y to enable the
backlight driver.
@@ -446,4 +433,4 @@ config BACKLIGHT_BD6107
endif # BACKLIGHT_CLASS_DEVICE
-endif # BACKLIGHT_LCD_SUPPORT
+endmenu
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 67409e0..dede128 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -184,7 +184,6 @@ config FB_MACMODES
config FB_BACKLIGHT
bool
depends on FB
- select BACKLIGHT_LCD_SUPPORT
select BACKLIGHT_CLASS_DEVICE
default n
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH v2 4/4] video: mmp: add device tree support
From: Zhou Zhu @ 2014-03-14 10:43 UTC (permalink / raw)
To: Tomi Valkeinen
Cc: Zhou Zhu, Mark Rutland,
linux-fbdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Jean-Christophe Plagniol-Villard, Haojian Zhuang, Sascha Hauer,
Jingoo Han, devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Chao Xie, Guoqing Li, Lisa Du, Yonghai Huang
In-Reply-To: <5316EF76.1050304-l0cyMroinI0@public.gmane.org>
Hi, Tomi,
On 03/05/2014 05:33 PM, Tomi Valkeinen wrote:
> I would recommend using the same style that is used in the OMAP DSS, imx
> drm and exynos patches that are introducing DT support. They use ports
> and endpoints as defined in:
>
> https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/media/video-interfaces.txt
>
> with the addition of a simplified endpoint format, where the 'port' node
> is not required.
>
> To give an idea what it could look like, I've modified your example
> above. It's just a rough example, you should study and think how it best
> fits for mmp.
>
> You could use the same format for the internal connections also, but I
> didn't touch that. I think internal connections can as well be
> configured separately, in a custom format, because there's no need for
> external components to connect to the internal links.
>
> mmp-disp@d420b000 {
> compatible = "marvell,mmp-disp";
> reg = <0xd420b000 0x1fc>;
> interrupts = <0 41 0x4>;
>
> internal-connections {
> pipe1: pn-path {
> input = "panel-graphic";
> output = &disp_out;
> }
> }
>
> disp_out: endpoint {
> remote-endpoint = <&panel_in>;
> marvell,rbswap;
> marvell,spi;
> };
>
> status = "okay";
> }
>
> panel-xxx {
> properties;
>
> panel_in: endpoint {
> remote-endpoint = <&disp_out>;
> };
> };
>
> Tomi
>
>
Thank you! I will update patches according to this layout later.
--
Thanks,
-Zhou
^ permalink raw reply
* Re: [PATCH] backlight: lm3639: use devm_backlight_device_register()
From: Lee Jones @ 2014-03-14 10:44 UTC (permalink / raw)
To: Jingoo Han
Cc: 'Bryan Wu', 'Daniel Jeong', linux-fbdev,
linux-kernel, 'Jean-Christophe Plagniol-Villard',
'Tomi Valkeinen'
In-Reply-To: <000901cf3f2c$3af30630$b0d91290$%han@samsung.com>
> >
> > change to use devm_backlight_device_register() for simple cleanup.
> >
> > Signed-off-by: Daniel Jeong <gshark.jeong@gmail.com>
>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
>
> Lee Jones,
> Would you merge this patch into your backlight tree?
Applied with Jingoo's Ack.
> > ---
> > drivers/video/backlight/lm3639_bl.c | 17 +++++++----------
> > 1 file changed, 7 insertions(+), 10 deletions(-)
> >
> > diff --git a/drivers/video/backlight/lm3639_bl.c b/drivers/video/backlight/lm3639_bl.c
> > index 6fd60ad..5f36808 100644
> > --- a/drivers/video/backlight/lm3639_bl.c
> > +++ b/drivers/video/backlight/lm3639_bl.c
> > @@ -349,8 +349,9 @@ static int lm3639_probe(struct i2c_client *client,
> > props.brightness = pdata->init_brt_led;
> > props.max_brightness = pdata->max_brt_led;
> > pchip->bled > > - backlight_device_register("lm3639_bled", pchip->dev, pchip,
> > - &lm3639_bled_ops, &props);
> > + devm_backlight_device_register(pchip->dev, "lm3639_bled",
> > + pchip->dev, pchip, &lm3639_bled_ops,
> > + &props);
> > if (IS_ERR(pchip->bled)) {
> > dev_err(&client->dev, "fail : backlight register\n");
> > ret = PTR_ERR(pchip->bled);
> > @@ -360,7 +361,7 @@ static int lm3639_probe(struct i2c_client *client,
> > ret = device_create_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> > if (ret < 0) {
> > dev_err(&client->dev, "failed : add sysfs entries\n");
> > - goto err_bled_mode;
> > + goto err_out;
> > }
> >
> > /* flash */
> > @@ -391,8 +392,6 @@ err_torch:
> > led_classdev_unregister(&pchip->cdev_flash);
> > err_flash:
> > device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> > -err_bled_mode:
> > - backlight_device_unregister(pchip->bled);
> > err_out:
> > return ret;
> > }
> > @@ -407,10 +406,8 @@ static int lm3639_remove(struct i2c_client *client)
> > led_classdev_unregister(&pchip->cdev_torch);
> > if (&pchip->cdev_flash)
> > led_classdev_unregister(&pchip->cdev_flash);
> > - if (pchip->bled) {
> > + if (pchip->bled)
> > device_remove_file(&(pchip->bled->dev), &dev_attr_bled_mode);
> > - backlight_device_unregister(pchip->bled);
> > - }
> > return 0;
> > }
> >
> > @@ -432,6 +429,6 @@ static struct i2c_driver lm3639_i2c_driver = {
> > module_i2c_driver(lm3639_i2c_driver);
> >
> > MODULE_DESCRIPTION("Texas Instruments Backlight+Flash LED driver for LM3639");
> > -MODULE_AUTHOR("Daniel Jeong <daniel.jeong@ti.com>");
> > -MODULE_AUTHOR("G.Shark Jeong <gshark.jeong@gmail.com>");
> > +MODULE_AUTHOR("Daniel Jeong <gshark.jeong@gmail.com>");
> > +MODULE_AUTHOR("Ldd Mlp <ldd-mlp@list.ti.com>");
> > MODULE_LICENSE("GPL v2");
>
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
^ permalink raw reply
* [PATCH v15][ 1/3] video: Kconfig: fbdev: restore the broader selection of FB_IMX
From: Denis Carikli @ 2014-03-14 10:55 UTC (permalink / raw)
To: linux-arm-kernel
The following patch:
b359bb0 video: Kconfig: Allow more broad selection of the imxfb framebuffer driver.
Was accidentally reverted by this one:
ed3b5f2 Merge branch '3.15/fb-reorder' into for-next
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v14->v15:
- New patch
---
drivers/video/fbdev/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/video/fbdev/Kconfig b/drivers/video/fbdev/Kconfig
index 67409e0..45fd7f3 100644
--- a/drivers/video/fbdev/Kconfig
+++ b/drivers/video/fbdev/Kconfig
@@ -327,7 +327,7 @@ config FB_SA1100
config FB_IMX
tristate "Freescale i.MX1/21/25/27 LCD support"
- depends on FB && IMX_HAVE_PLATFORM_IMX_FB
+ depends on FB && ARCH_MXC
select FB_CFB_FILLRECT
select FB_CFB_COPYAREA
select FB_CFB_IMAGEBLIT
--
1.7.9.5
^ permalink raw reply related
* [PATCH v15][ 2/3] video: imxfb: Add DT default contrast control register property.
From: Denis Carikli @ 2014-03-14 10:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394794553-14719-1-git-send-email-denis@eukrea.com>
Signed-off-by: Denis Carikli <denis@eukrea.com>
Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Acked-by: Grant Likely <grant.likely@linaro.org>
---
ChangeLog v14->v15:
- Moved the Cc into git send-email.
- Rebased.
ChangeLog v5->v14:
- Remove people not concerned by this patch from the Cc list.
- Changed the property name to match the register name and function.
- Updated the documentation, code and commit message accordingly.
---
.../devicetree/bindings/video/fsl,imx-fb.txt | 3 +++
drivers/video/fbdev/imxfb.c | 3 +++
2 files changed, 6 insertions(+)
diff --git a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
index e6b1ee9..0329f60 100644
--- a/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
+++ b/Documentation/devicetree/bindings/video/fsl,imx-fb.txt
@@ -18,6 +18,9 @@ Optional properties:
- lcd-supply: Regulator for LCD supply voltage.
- fsl,dmacr: DMA Control Register value. This is optional. By default, the
register is not modified as recommended by the datasheet.
+- fsl,lpccr: Contrast Control Register value. This property provides the
+ default value for the contrast control register.
+ If that property is ommited, the register is zeroed.
- fsl,lscr1: LCDC Sharp Configuration Register value.
Example:
diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index 086e024..f6e6216 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -670,6 +670,9 @@ static int imxfb_init_fbinfo(struct platform_device *pdev)
fbi->cmap_static = of_property_read_bool(np, "cmap-static");
fbi->lscr1 = IMXFB_LSCR1_DEFAULT;
+
+ of_property_read_u32(np, "fsl,lpccr", &fbi->pwmr);
+
of_property_read_u32(np, "fsl,lscr1", &fbi->lscr1);
of_property_read_u32(np, "fsl,dmacr", &fbi->dmacr);
--
1.7.9.5
^ permalink raw reply related
* =?UTF-8?q?=5BPATCH=20v15=5D=5B=203/3=5D=20ARM=3A=20dts=3A=20imx25=3A=20mbimxsd25=3A=20Add=20displays
From: Denis Carikli @ 2014-03-14 10:55 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394794553-14719-1-git-send-email-denis@eukrea.com>
The CMO-QVGA(With backlight), DVI-VGA and DVI-SVGA displays
were added.
Signed-off-by: Denis Carikli <denis@eukrea.com>
---
ChangeLog v14->v15:
- Moved the Cc into git-send-email.
- Added a reg property in the regulator@0 node.
ChangeLog v13->v14:
- Remove people not concerned by this patch from the Cc list.
- changed the fsl,pwmr lcdc property to fsl,lpccr,
to match the previous patches in that serie.
ChangeLog v10->v13:
- This patch is the display part splitted out from the patch adding
support for the cpuimx25(and its baseboard).
- Shawn Guo was added to the Cc list.
- The regulator part was updated to match the current style.
- The new GPIO defines are now used in the dts(i).
---
.../imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts | 72 ++++++++++++++++++++
.../imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts | 45 ++++++++++++
.../imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts | 45 ++++++++++++
3 files changed, 163 insertions(+)
create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts
create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts
create mode 100644 arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts
diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts
new file mode 100644
index 0000000..68d0834
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-cmo-qvga.dts
@@ -0,0 +1,73 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx25-eukrea-mbimxsd25-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD25 with the CMO-QVGA Display";
+ compatible = "eukrea,mbimxsd25-baseboard-cmo-qvga", "eukrea,mbimxsd25-baseboard", "eukrea,cpuimx25", "fsl,imx25";
+
+ cmo_qvga: display {
+ model = "CMO-QVGA";
+ bits-per-pixel = <16>;
+ fsl,pcr = <0xcad08b80>;
+ bus-width = <18>;
+ native-mode = <&qvga_timings>;
+ display-timings {
+ qvga_timings: 320x240 {
+ clock-frequency = <6500000>;
+ hactive = <320>;
+ vactive = <240>;
+ hback-porch = <30>;
+ hfront-porch = <38>;
+ vback-porch = <20>;
+ vfront-porch = <3>;
+ hsync-len = <15>;
+ vsync-len = <4>;
+ };
+ };
+ };
+
+ regulators {
+ compatible = "simple-bus";
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ reg_lcd_3v3: regulator@0 {
+ compatible = "regulator-fixed";
+ reg = <0>;
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_reg_lcd_3v3>;
+ regulator-name = "lcd-3v3";
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ gpio = <&gpio1 26 GPIO_ACTIVE_HIGH>;
+ enable-active-high;
+ };
+ };
+};
+
+&iomuxc {
+ imx25-eukrea-mbimxsd25-baseboard-cmo-qvga {
+ pinctrl_reg_lcd_3v3: reg_lcd_3v3 {
+ fsl,pins = <MX25_PAD_PWM__GPIO_1_26 0x80000000>;
+ };
+ };
+};
+
+&lcdc {
+ display = <&cmo_qvga>;
+ fsl,lpccr = <0x00a903ff>;
+ lcd-supply = <®_lcd_3v3>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts
new file mode 100644
index 0000000..8eee2f6
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-svga.dts
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx25-eukrea-mbimxsd25-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD25 with the DVI-SVGA Display";
+ compatible = "eukrea,mbimxsd25-baseboard-dvi-svga", "eukrea,mbimxsd25-baseboard", "eukrea,cpuimx25", "fsl,imx25";
+
+ dvi_svga: display {
+ model = "DVI-SVGA";
+ bits-per-pixel = <16>;
+ fsl,pcr = <0xfa208b80>;
+ bus-width = <18>;
+ native-mode = <&dvi_svga_timings>;
+ display-timings {
+ dvi_svga_timings: 800x600 {
+ clock-frequency = <40000000>;
+ hactive = <800>;
+ vactive = <600>;
+ hback-porch = <75>;
+ hfront-porch = <75>;
+ vback-porch = <7>;
+ vfront-porch = <75>;
+ hsync-len = <7>;
+ vsync-len = <7>;
+ };
+ };
+ };
+};
+
+&lcdc {
+ display = <&dvi_svga>;
+ status = "okay";
+};
diff --git a/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts
new file mode 100644
index 0000000..447da62
--- /dev/null
+++ b/arch/arm/boot/dts/imx25-eukrea-mbimxsd25-baseboard-dvi-vga.dts
@@ -0,0 +1,45 @@
+/*
+ * Copyright 2013 Eukréa Electromatique <denis@eukrea.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.
+ * This program 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.
+ */
+
+#include "imx25-eukrea-mbimxsd25-baseboard.dts"
+
+/ {
+ model = "Eukrea MBIMXSD25 with the DVI-VGA Display";
+ compatible = "eukrea,mbimxsd25-baseboard-dvi-vga", "eukrea,mbimxsd25-baseboard", "eukrea,cpuimx25", "fsl,imx25";
+
+ dvi_vga: display {
+ model = "DVI-VGA";
+ bits-per-pixel = <16>;
+ fsl,pcr = <0xfa208b80>;
+ bus-width = <18>;
+ native-mode = <&dvi_vga_timings>;
+ display-timings {
+ dvi_vga_timings: 640x480 {
+ clock-frequency = <31250000>;
+ hactive = <640>;
+ vactive = <480>;
+ hback-porch = <100>;
+ hfront-porch = <100>;
+ vback-porch = <7>;
+ vfront-porch = <100>;
+ hsync-len = <7>;
+ vsync-len = <7>;
+ };
+ };
+ };
+};
+
+&lcdc {
+ display = <&dvi_vga>;
+ status = "okay";
+};
--
1.7.9.5
^ permalink raw reply related
* [PATCH v2] lcd: Provide dummy functions if CONFIG_LCD_CLASS_DEVICE is not set
From: Alexander Shiyan @ 2014-03-14 11:09 UTC (permalink / raw)
To: linux-fbdev
Provide dummy functions for LCD register()/unregister() if
CONFIG_LCD_CLASS_DEVICE is not set.
This allows us to use the LCD class as an optional.
Signed-off-by: Alexander Shiyan <shc_work@mail.ru>
---
include/linux/lcd.h | 37 ++++++++++++++++++++++++++++++-------
1 file changed, 30 insertions(+), 7 deletions(-)
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index 504f624..39c41c7 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -110,14 +110,37 @@ static inline void lcd_set_power(struct lcd_device *ld, int power)
mutex_unlock(&ld->update_lock);
}
-extern struct lcd_device *lcd_device_register(const char *name,
- struct device *parent, void *devdata, struct lcd_ops *ops);
-extern struct lcd_device *devm_lcd_device_register(struct device *dev,
- const char *name, struct device *parent,
+#if defined(CONFIG_LCD_CLASS_DEVICE) || defined(CONFIG_LCD_CLASS_DEVICE_MODULE)
+struct lcd_device *lcd_device_register(const char *name, struct device *parent,
void *devdata, struct lcd_ops *ops);
-extern void lcd_device_unregister(struct lcd_device *ld);
-extern void devm_lcd_device_unregister(struct device *dev,
- struct lcd_device *ld);
+struct lcd_device *devm_lcd_device_register(struct device *dev,
+ const char *name, struct device *parent, void *devdata,
+ struct lcd_ops *ops);
+void lcd_device_unregister(struct lcd_device *ld);
+void devm_lcd_device_unregister(struct device *dev, struct lcd_device *ld);
+#else
+static inline struct lcd_device *lcd_device_register(const char *name,
+ struct device *parent, void *devdata, struct lcd_ops *ops)
+{
+ return NULL;
+}
+
+static inline struct lcd_device *devm_lcd_device_register(struct device *dev,
+ const char *name, struct device *parent, void *devdata,
+ struct lcd_ops *ops)
+{
+ return NULL;
+}
+
+static inline void lcd_device_unregister(struct lcd_device *ld)
+{
+}
+
+static inline void devm_lcd_device_unregister(struct device *dev,
+ struct lcd_device *ld)
+{
+}
+#endif
#define to_lcd_device(obj) container_of(obj, struct lcd_device, dev)
--
1.8.3.2
^ permalink raw reply related
* Re: [PATCH v7][ 3/5] video: mx3fb: Introduce regulator support.
From: Denis Carikli @ 2014-03-14 11:23 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1394789035.649593084@f301.i.mail.ru>
On 03/14/2014 10:23 AM, Alexander Shiyan wrote:
> Why this cannot be devm_regulator_get(dev, "lcd") in both DT and non-DT case?
I need to add device tree support to the mx3fb driver.
My first approach gave a binding that looked like that:
cmo_qvga: display {
model = "CMO-QVGA";
[...]
display-timings {
qvga_timings: 320x240 {
hactive = <320>;
vactive = <240>;
[...]
};
};
ipu: ipu@53fc0000 {
compatible = "fsl,imx31-ipu";
reg = < 0x53fc0000 0x5f
0x53fc0088 0x2b >;
interrupts = <42 41>;
dma-channels = <32>;
#dma-cells = <1>;
clocks = <&clks 55>;
clock-names = "";
};
lcdc: mx3fb@53fc00b4 {
compatible = "fsl,mx3-fb";
reg = <0x53fc00b4 0x0b>;
clocks = <&clks 55>;
dmas = <&ipu 14>;
dma-names = "tx";
display = <&cmo_qvga>;
};
The issue was that exporting the "dma ipu driver" was not a good idea.
I was told to instead make bindings that looks very similar to the ipuv3
driver[1]
So at the end that gave something like that:
cmo_qvga: display@di0 {
compatible = "fsl,mx3-parallel-display";
regulator-name = "lcd";
lcd-supply = <®_lcd_3v3>;
model = "CMO-QVGA";
display-timings {
qvga_timings: 320x240 {
hactive = <320>;
vactive = <240>;
[...]
};
};
ipu: ipu@53fc0000 {
compatible = "fsl,imx35-ipu";
reg = <0x53fc0000 0x4000>;
clocks = <&clks 55>;
display = <&cmo_qvga>;
};
So here fsl,imx35-ipu is binded to the mx3fb driver.
But the mx3fb driver still need to use the dma-ipu driver somehow.
That's why the dma-ipu driver is handled behind the scenes, that way
it's not exported to the device tree bindings.
Now, since the mx3fb driver is binded to the "fsl,imx35-ipu" compatible,
if I would do a "mx3fbi->reg_lcd = devm_regulator_get(dev, "lcd");",
that would then lookup for the regulator in the mx3fb node
(The last "ipu@53fc0000" here).
Instead the regulator can be found in the display node,
which has no driver associated with it.
In the case of the ipuv3, the parallel display driver is associated
with the display@di0 node, so the device matches with the device tree
node directly.
References:
-----------
[1] The ipuv3 driver is in drivers/staging/imx-drm/
[2] the dma ipu driver is in drivers/dma/ipu/
Denis.
^ permalink raw reply
* Re: [PATCH v7][ 3/5] video: mx3fb: Introduce =?UTF-8?B?cmVndWxhdG9yIHN1c
From: Alexander Shiyan @ 2014-03-14 12:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <5322E6AA.1010400@eukrea.com>
0J/Rj9GC0L3Qu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zcGxheUBkaTAgbm9kZSwgc28gdGhlIGRldmljZSBtYXRjaGVzIHdp
dGggdGhlIGRldmljZSB0cmVlCj4gbm9kZSBkaXJlY3RseS4KPiAKPiBSZWZlcmVuY2VzOgo+IC0t
LS0tLS0tLS0tCj4gWzFdIFRoZSBpcHV2MyBkcml2ZXIgaXMgaW4gZHJpdmVycy9zdGFnaW5nL2lt
eC1kcm0vCj4gWzJdIHRoZSBkbWEgaXB1IGRyaXZlciBpcyBpbiBkcml2ZXJzL2RtYS9pcHUvCj4g
CgotLS0K
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox