Linux Framebuffer Layer development
 help / color / mirror / Atom feed
* Re: [PATCH 1/4] staging: sm750fb: wrong type for print
From: Dan Carpenter @ 2015-03-09  9:22 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <1425817886-14387-1-git-send-email-sudipm.mukherjee@gmail.com>

On Sun, Mar 08, 2015 at 06:01:23PM +0530, Sudip Mukherjee wrote:
> diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
> index 711676c..2ab7b74 100644
> --- a/drivers/staging/sm750fb/sm750.h
> +++ b/drivers/staging/sm750fb/sm750.h
> @@ -59,10 +59,10 @@ struct lynx_share{
>  		}mtrr;
>  #endif
>  	/* all smi graphic adaptor got below attributes */
> -	resource_size_t vidmem_start;
> -	resource_size_t vidreg_start;
> -	resource_size_t vidmem_size;
> -	resource_size_t vidreg_size;
> +	unsigned long vidmem_start;
> +	unsigned long vidreg_start;
> +	unsigned long vidmem_size;
> +	unsigned long vidreg_size;
>  	volatile unsigned char __iomem * pvReg;
>  	unsigned char __iomem * pvMem;
>  	/* locks*/

This seems like a very risky sort of change.  It's not explained very
well in the changelog.  What's the deal?

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH v11 1/6] mfd: Add support for Skyworks SKY81452 driver
From: Lee Jones @ 2015-03-09  9:40 UTC (permalink / raw)
  To: gyungoh-Re5JQEeQqe8AvxtiuMwx3w
  Cc: sameo-VuQAYsv1563Yd54FQh9/CA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	jg1.han-Sze3O3UU22JBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, trivial-DgEjT+Ai2ygdnm+yROfE0A,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, florian.vaussard-p8DiymsW2f8,
	andrew-g2DYL2Zd6BY, antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w,
	hytszk-Re5JQEeQqe8AvxtiuMwx3w, plagnioj-sclMFOaUSTBWk0Htik3J/w,
	tomi.valkeinen-l0cyMroinI0, jack.yoo-tjhQNA90jdKqndwCJWfcng,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, treding-DDmLM1+adcrQT0dZR+AlfA,
	p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ, arno-LkuqDEemtHBg9hUCZPvPmw,
	kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ
In-Reply-To: <1425019346-4559-2-git-send-email-jack.yoo-tjhQNA90jdKqndwCJWfcng@public.gmane.org>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> ---
> Changes v11:
> Nothing
> 
> Changes v10:
> Nothing
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Nothing
> 
> Changes v7:
> Modified licensing text to GPLv2
> 
> Changes v6:
> Added new line character at the end of line of dev_err()
> 
> Changes v5:
> Move sky81452-backlight.h to include/linux/platform_data
> 
> Changes v4:
> Removed MODULE_VERSION()
> Modified license to GPLv2
> 
> Changes v3:
> Fixed the backlight name from 'sky81452-bl' to 'sky81452-backlight'
> Assigned mfd_cell.of_compatible for binding device node
> Modified error messages
> 
> Changes v2:
> Renamed CONFIG_SKY81452 to CONFIG_MFD_SKY81452
> Changed the dependency from I2C=y to I2C, for CONFIG_MFD_SKY81452
> Added message for exception or errors
> 
>  drivers/mfd/Kconfig          |  12 +++++
>  drivers/mfd/Makefile         |   1 +
>  drivers/mfd/sky81452.c       | 108 +++++++++++++++++++++++++++++++++++++++++++
>  include/linux/mfd/sky81452.h |  31 +++++++++++++
>  4 files changed, 152 insertions(+)
>  create mode 100644 drivers/mfd/sky81452.c
>  create mode 100644 include/linux/mfd/sky81452.h
> 
> diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig
> index 38356e3..bc3b540 100644
> --- a/drivers/mfd/Kconfig
> +++ b/drivers/mfd/Kconfig
> @@ -753,6 +753,18 @@ config MFD_SM501_GPIO
>  	 lines on the SM501. The platform data is used to supply the
>  	 base number for the first GPIO line to register.
>  
> +config MFD_SKY81452
> +	tristate "Skyworks Solutions SKY81452"
> +	select MFD_CORE
> +	select REGMAP_I2C
> +	depends on I2C
> +	help
> +	  This is the core driver for the Skyworks SKY81452 backlight and
> +	  voltage regulator device.
> +
> +	  This driver can also be built as a module.  If so, the module
> +	  will be called sky81452.
> +
>  config MFD_SMSC
>         bool "SMSC ECE1099 series chips"
>         depends on I2C=y
> diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile
> index 19f3d74..75b3ffb 100644
> --- a/drivers/mfd/Makefile
> +++ b/drivers/mfd/Makefile
> @@ -178,6 +178,7 @@ obj-$(CONFIG_MFD_MENF21BMC)	+= menf21bmc.o
>  obj-$(CONFIG_MFD_HI6421_PMIC)	+= hi6421-pmic-core.o
>  obj-$(CONFIG_MFD_DLN2)		+= dln2.o
>  obj-$(CONFIG_MFD_RT5033)	+= rt5033.o
> +obj-$(CONFIG_MFD_SKY81452)	+= sky81452.o
>  
>  intel-soc-pmic-objs		:= intel_soc_pmic_core.o intel_soc_pmic_crc.o
>  obj-$(CONFIG_INTEL_SOC_PMIC)	+= intel-soc-pmic.o
> diff --git a/drivers/mfd/sky81452.c b/drivers/mfd/sky81452.c
> new file mode 100644
> index 0000000..b0c9b04
> --- /dev/null
> +++ b/drivers/mfd/sky81452.c
> @@ -0,0 +1,108 @@
> +/*
> + * sky81452.c	SKY81452 MFD driver
> + *
> + * Copyright 2014 Skyworks Solutions Inc.
> + * Author : Gyungoh Yoo <jack.yoo@skyworksinc.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.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/init.h>
> +#include <linux/err.h>
> +#include <linux/slab.h>
> +#include <linux/i2c.h>
> +#include <linux/regmap.h>
> +#include <linux/mfd/core.h>
> +#include <linux/mfd/sky81452.h>
> +
> +static const struct regmap_config sky81452_config = {
> +	.reg_bits = 8,
> +	.val_bits = 8,
> +};
> +
> +static int sky81452_probe(struct i2c_client *client,
> +				const struct i2c_device_id *id)
> +{
> +	struct device *dev = &client->dev;
> +	const struct sky81452_platform_data *pdata = dev_get_platdata(dev);
> +	struct mfd_cell cells[2];
> +	struct regmap *regmap;
> +	int ret;
> +
> +	if (!pdata) {
> +		pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> +		if (!pdata)
> +			return -ENOMEM;
> +	}
> +
> +	regmap = devm_regmap_init_i2c(client, &sky81452_config);
> +	if (IS_ERR(regmap)) {
> +		dev_err(dev, "failed to initialize.err=%ld\n", PTR_ERR(regmap));
> +		return PTR_ERR(regmap);
> +	}
> +
> +	i2c_set_clientdata(client, regmap);
> +
> +	memset(cells, 0, sizeof(cells));
> +	cells[0].name = "sky81452-backlight";
> +	cells[0].of_compatible = "skyworks,sky81452-backlight";
> +	cells[0].platform_data = pdata->bl_pdata;
> +	cells[0].pdata_size = sizeof(*pdata->bl_pdata);
> +	cells[1].name = "sky81452-regulator";
> +	cells[1].platform_data = pdata->regulator_init_data;
> +	cells[1].pdata_size = sizeof(*pdata->regulator_init_data);
> +
> +	ret = mfd_add_devices(dev, -1, cells, ARRAY_SIZE(cells), NULL, 0, NULL);
> +	if (ret)
> +		dev_err(dev, "failed to add child devices. err=%d\n", ret);
> +
> +	return ret;
> +}
> +
> +static int sky81452_remove(struct i2c_client *client)
> +{
> +	mfd_remove_devices(&client->dev);
> +	return 0;
> +}
> +
> +static const struct i2c_device_id sky81452_ids[] = {
> +	{ "sky81452" },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(i2c, sky81452_ids);
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id sky81452_of_match[] = {
> +	{ .compatible = "skyworks,sky81452", },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, sky81452_of_match);
> +#endif
> +
> +static struct i2c_driver sky81452_driver = {
> +	.driver = {
> +		.name = "sky81452",
> +		.of_match_table = of_match_ptr(sky81452_of_match),
> +	},
> +	.probe = sky81452_probe,
> +	.remove = sky81452_remove,
> +	.id_table = sky81452_ids,
> +};
> +
> +module_i2c_driver(sky81452_driver);
> +
> +MODULE_DESCRIPTION("Skyworks SKY81452 MFD driver");
> +MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
> +MODULE_LICENSE("GPL v2");
> diff --git a/include/linux/mfd/sky81452.h b/include/linux/mfd/sky81452.h
> new file mode 100644
> index 0000000..b0925fa
> --- /dev/null
> +++ b/include/linux/mfd/sky81452.h
> @@ -0,0 +1,31 @@
> +/*
> + * sky81452.h	SKY81452 MFD driver
> + *
> + * Copyright 2014 Skyworks Solutions Inc.
> + * Author : Gyungoh Yoo <jack.yoo@skyworksinc.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.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef _SKY81452_H
> +#define _SKY81452_H
> +
> +#include <linux/platform_data/sky81452-backlight.h>
> +#include <linux/regulator/machine.h>
> +
> +struct sky81452_platform_data {
> +	struct sky81452_bl_platform_data *bl_pdata;
> +	struct regulator_init_data *regulator_init_data;
> +};
> +
> +#endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v11 2/6] backlight: Add support Skyworks SKY81452 backlight driver
From: Lee Jones @ 2015-03-09  9:40 UTC (permalink / raw)
  To: gyungoh
  Cc: sameo, robh+dt, jg1.han, pawel.moll, mark.rutland, ijc+devicetree,
	galak, trivial, broonie, florian.vaussard, andrew, antonynpavlov,
	hytszk, plagnioj, tomi.valkeinen, jack.yoo, linux-fbdev,
	linux-kernel, devicetree, treding, p.zabel, arno,
	kuninori.morimoto.gx
In-Reply-To: <1425019346-4559-3-git-send-email-jack.yoo@skyworksinc.com>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Jingoo Han <jg1.han@samsung.com>
> Acked-by: Bryan Wu <cooloney@gmail.com>
> ---
> Changes v11:
> Renamed 'skyworks,en-channels' property to led-sources.
> 
> Changes v10:
> Removed trivial get_brightness implementations
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Renamed property names for backlight with vendor prefix
> Modified gpio-enable property to generic property for GPIO
> 
> Changes v7:
> Modified licensing text to GPLv2
> 
> Changes v6:
> Added new line character at the end of line of dev_err()
> 
> Changes v5:
> Move sky81452-backlight.h to include/linux/platform_data
> 
> Changes v4:
> Reordering header files for readability
> Removed calling to backlight_device_unregister()
> Removed MODULE_VERSION()
> Modified license to GPLv2
> 
> Changes v3:
> Modified DBG messages
> 
> Changes v2:
> Added 'compatible' attribute in the driver
> Added message for exception or errors
> 
>  drivers/video/backlight/Kconfig                  |  10 +
>  drivers/video/backlight/Makefile                 |   1 +
>  drivers/video/backlight/sky81452-backlight.c     | 353 +++++++++++++++++++++++
>  include/linux/platform_data/sky81452-backlight.h |  46 +++
>  4 files changed, 410 insertions(+)
>  create mode 100644 drivers/video/backlight/sky81452-backlight.c
>  create mode 100644 include/linux/platform_data/sky81452-backlight.h
> 
> diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
> index efb0904..2d9923a 100644
> --- a/drivers/video/backlight/Kconfig
> +++ b/drivers/video/backlight/Kconfig
> @@ -408,6 +408,16 @@ config BACKLIGHT_PANDORA
>  	  If you have a Pandora console, say Y to enable the
>  	  backlight driver.
>  
> +config BACKLIGHT_SKY81452
> +	tristate "Backlight driver for SKY81452"
> +	depends on BACKLIGHT_CLASS_DEVICE && MFD_SKY81452
> +	help
> +	  If you have a Skyworks SKY81452, say Y to enable the
> +	  backlight driver.
> +
> +	  To compile this driver as a module, choose M here: the module will
> +	  be called sky81452-backlight
> +
>  config BACKLIGHT_TPS65217
>  	tristate "TPS65217 Backlight"
>  	depends on BACKLIGHT_CLASS_DEVICE && MFD_TPS65217
> diff --git a/drivers/video/backlight/Makefile b/drivers/video/backlight/Makefile
> index fcd50b73..d67073f 100644
> --- a/drivers/video/backlight/Makefile
> +++ b/drivers/video/backlight/Makefile
> @@ -50,6 +50,7 @@ obj-$(CONFIG_BACKLIGHT_PANDORA)		+= pandora_bl.o
>  obj-$(CONFIG_BACKLIGHT_PCF50633)	+= pcf50633-backlight.o
>  obj-$(CONFIG_BACKLIGHT_PWM)		+= pwm_bl.o
>  obj-$(CONFIG_BACKLIGHT_SAHARA)		+= kb3886_bl.o
> +obj-$(CONFIG_BACKLIGHT_SKY81452)	+= sky81452-backlight.o
>  obj-$(CONFIG_BACKLIGHT_TOSA)		+= tosa_bl.o
>  obj-$(CONFIG_BACKLIGHT_TPS65217)	+= tps65217_bl.o
>  obj-$(CONFIG_BACKLIGHT_WM831X)		+= wm831x_bl.o
> diff --git a/drivers/video/backlight/sky81452-backlight.c b/drivers/video/backlight/sky81452-backlight.c
> new file mode 100644
> index 0000000..052fa1b
> --- /dev/null
> +++ b/drivers/video/backlight/sky81452-backlight.c
> @@ -0,0 +1,353 @@
> +/*
> + * sky81452-backlight.c	SKY81452 backlight driver
> + *
> + * Copyright 2014 Skyworks Solutions Inc.
> + * Author : Gyungoh Yoo <jack.yoo@skyworksinc.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.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#include <linux/backlight.h>
> +#include <linux/err.h>
> +#include <linux/gpio.h>
> +#include <linux/init.h>
> +#include <linux/kernel.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
> +#include <linux/of_gpio.h>
> +#include <linux/platform_device.h>
> +#include <linux/regmap.h>
> +#include <linux/platform_data/sky81452-backlight.h>
> +#include <linux/slab.h>
> +
> +/* registers */
> +#define SKY81452_REG0	0x00
> +#define SKY81452_REG1	0x01
> +#define SKY81452_REG2	0x02
> +#define SKY81452_REG4	0x04
> +#define SKY81452_REG5	0x05
> +
> +/* bit mask */
> +#define SKY81452_CS	0xFF
> +#define SKY81452_EN	0x3F
> +#define SKY81452_IGPW	0x20
> +#define SKY81452_PWMMD	0x10
> +#define SKY81452_PHASE	0x08
> +#define SKY81452_ILIM	0x04
> +#define SKY81452_VSHRT	0x03
> +#define SKY81452_OCP	0x80
> +#define SKY81452_OTMP	0x40
> +#define SKY81452_SHRT	0x3F
> +#define SKY81452_OPN	0x3F
> +
> +#define SKY81452_DEFAULT_NAME "lcd-backlight"
> +#define SKY81452_MAX_BRIGHTNESS	(SKY81452_CS + 1)
> +
> +#define CTZ(b) __builtin_ctz(b)
> +
> +static int sky81452_bl_update_status(struct backlight_device *bd)
> +{
> +	const struct sky81452_bl_platform_data *pdata > +			dev_get_platdata(bd->dev.parent);
> +	const unsigned int brightness = (unsigned int)bd->props.brightness;
> +	struct regmap *regmap = bl_get_data(bd);
> +	int ret;
> +
> +	if (brightness > 0) {
> +		ret = regmap_write(regmap, SKY81452_REG0, brightness - 1);
> +		if (IS_ERR_VALUE(ret))
> +			return ret;
> +
> +		return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN,
> +					pdata->enable << CTZ(SKY81452_EN));
> +	}
> +
> +	return regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN, 0);
> +}
> +
> +static const struct backlight_ops sky81452_bl_ops = {
> +	.update_status = sky81452_bl_update_status,
> +};
> +
> +static ssize_t sky81452_bl_store_enable(struct device *dev,
> +		struct device_attribute *attr, const char *buf, size_t count)
> +{
> +	struct regmap *regmap = bl_get_data(to_backlight_device(dev));
> +	unsigned long value;
> +	int ret;
> +
> +	ret = kstrtoul(buf, 16, &value);
> +	if (IS_ERR_VALUE(ret))
> +		return ret;
> +
> +	ret = regmap_update_bits(regmap, SKY81452_REG1, SKY81452_EN,
> +					value << CTZ(SKY81452_EN));
> +	if (IS_ERR_VALUE(ret))
> +		return ret;
> +
> +	return count;
> +}
> +
> +static ssize_t sky81452_bl_show_open_short(struct device *dev,
> +		struct device_attribute *attr, char *buf)
> +{
> +	struct regmap *regmap = bl_get_data(to_backlight_device(dev));
> +	unsigned int reg, value = 0;
> +	char tmp[3];
> +	int i, ret;
> +
> +	reg = !strcmp(attr->attr.name, "open") ? SKY81452_REG5 : SKY81452_REG4;
> +	ret = regmap_read(regmap, reg, &value);
> +	if (IS_ERR_VALUE(ret))
> +		return ret;
> +
> +	if (value & SKY81452_SHRT) {
> +		*buf = 0;
> +		for (i = 0; i < 6; i++) {
> +			if (value & 0x01) {
> +				sprintf(tmp, "%d ", i + 1);
> +				strcat(buf, tmp);
> +			}
> +			value >>= 1;
> +		}
> +		strcat(buf, "\n");
> +	} else {
> +		strcpy(buf, "none\n");
> +	}
> +
> +	return strlen(buf);
> +}
> +
> +static ssize_t sky81452_bl_show_fault(struct device *dev,
> +		struct device_attribute *attr, char *buf)
> +{
> +	struct regmap *regmap = bl_get_data(to_backlight_device(dev));
> +	unsigned int value = 0;
> +	int ret;
> +
> +	ret = regmap_read(regmap, SKY81452_REG4, &value);
> +	if (IS_ERR_VALUE(ret))
> +		return ret;
> +
> +	*buf = 0;
> +
> +	if (value & SKY81452_OCP)
> +		strcat(buf, "over-current ");
> +
> +	if (value & SKY81452_OTMP)
> +		strcat(buf, "over-temperature");
> +
> +	strcat(buf, "\n");
> +	return strlen(buf);
> +}
> +
> +static DEVICE_ATTR(enable, S_IWGRP | S_IWUSR, NULL, sky81452_bl_store_enable);
> +static DEVICE_ATTR(open, S_IRUGO, sky81452_bl_show_open_short, NULL);
> +static DEVICE_ATTR(short, S_IRUGO, sky81452_bl_show_open_short, NULL);
> +static DEVICE_ATTR(fault, S_IRUGO, sky81452_bl_show_fault, NULL);
> +
> +static struct attribute *sky81452_bl_attribute[] = {
> +	&dev_attr_enable.attr,
> +	&dev_attr_open.attr,
> +	&dev_attr_short.attr,
> +	&dev_attr_fault.attr,
> +	NULL
> +};
> +
> +static const struct attribute_group sky81452_bl_attr_group = {
> +	.attrs = sky81452_bl_attribute,
> +};
> +
> +#ifdef CONFIG_OF
> +static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
> +							struct device *dev)
> +{
> +	struct device_node *np = of_node_get(dev->of_node);
> +	struct sky81452_bl_platform_data *pdata;
> +	int num_entry;
> +	unsigned int sources[6];
> +	int ret;
> +
> +	if (!np) {
> +		dev_err(dev, "backlight node not found.\n");
> +		return ERR_PTR(-ENODATA);
> +	}
> +
> +	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> +	if (!pdata) {
> +		of_node_put(np);
> +		return ERR_PTR(-ENOMEM);
> +	}
> +
> +	of_property_read_string(np, "name", &pdata->name);
> +	pdata->ignore_pwm = of_property_read_bool(np, "skyworks,ignore-pwm");
> +	pdata->dpwm_mode = of_property_read_bool(np, "skyworks,dpwm-mode");
> +	pdata->phase_shift = of_property_read_bool(np, "skyworks,phase-shift");
> +	pdata->gpio_enable = of_get_gpio(np, 0);
> +
> +	ret = of_property_count_u32_elems(np, "led-sources");
> +	if (IS_ERR_VALUE(ret)) {
> +		pdata->enable = SKY81452_EN >> CTZ(SKY81452_EN);
> +	} else {
> +		num_entry = ret;
> +		if (num_entry > 6)
> +			num_entry = 6;
> +
> +		ret = of_property_read_u32_array(np, "led-sources", sources,
> +					num_entry);
> +		if (IS_ERR_VALUE(ret)) {
> +			dev_err(dev, "led-sources node is invalid.\n");
> +			return ERR_PTR(-EINVAL);
> +		}
> +
> +		pdata->enable = 0;
> +		while (--num_entry)
> +			pdata->enable |= (1 << sources[num_entry]);
> +	}
> +
> +	ret = of_property_read_u32(np,
> +			"skyworks,short-detection-threshold-volt",
> +			&pdata->short_detection_threshold);
> +	if (IS_ERR_VALUE(ret))
> +		pdata->short_detection_threshold = 7;
> +
> +	ret = of_property_read_u32(np, "skyworks,current-limit-mA",
> +			&pdata->boost_current_limit);
> +	if (IS_ERR_VALUE(ret))
> +		pdata->boost_current_limit = 2750;
> +
> +	of_node_put(np);
> +	return pdata;
> +}
> +#else
> +static struct sky81452_bl_platform_data *sky81452_bl_parse_dt(
> +							struct device *dev)
> +{
> +	return ERR_PTR(-EINVAL);
> +}
> +#endif
> +
> +static int sky81452_bl_init_device(struct regmap *regmap,
> +		struct sky81452_bl_platform_data *pdata)
> +{
> +	unsigned int value;
> +
> +	value = pdata->ignore_pwm ? SKY81452_IGPW : 0;
> +	value |= pdata->dpwm_mode ? SKY81452_PWMMD : 0;
> +	value |= pdata->phase_shift ? 0 : SKY81452_PHASE;
> +
> +	if (pdata->boost_current_limit = 2300)
> +		value |= SKY81452_ILIM;
> +	else if (pdata->boost_current_limit != 2750)
> +		return -EINVAL;
> +
> +	if (pdata->short_detection_threshold < 4 ||
> +				pdata->short_detection_threshold > 7)
> +		return -EINVAL;
> +	value |= (7 - pdata->short_detection_threshold) << CTZ(SKY81452_VSHRT);
> +
> +	return regmap_write(regmap, SKY81452_REG2, value);
> +}
> +
> +static int sky81452_bl_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct regmap *regmap = dev_get_drvdata(dev->parent);
> +	struct sky81452_bl_platform_data *pdata = dev_get_platdata(dev);
> +	struct backlight_device *bd;
> +	struct backlight_properties props;
> +	const char *name;
> +	int ret;
> +
> +	if (!pdata) {
> +		pdata = sky81452_bl_parse_dt(dev);
> +		if (IS_ERR(pdata))
> +			return PTR_ERR(pdata);
> +	}
> +
> +	if (gpio_is_valid(pdata->gpio_enable)) {
> +		ret = devm_gpio_request_one(dev, pdata->gpio_enable,
> +					GPIOF_OUT_INIT_HIGH, "sky81452-en");
> +		if (IS_ERR_VALUE(ret)) {
> +			dev_err(dev, "failed to request GPIO. err=%d\n", ret);
> +			return ret;
> +		}
> +	}
> +
> +	ret = sky81452_bl_init_device(regmap, pdata);
> +	if (IS_ERR_VALUE(ret)) {
> +		dev_err(dev, "failed to initialize. err=%d\n", ret);
> +		return ret;
> +	}
> +
> +	memset(&props, 0, sizeof(props));
> +	props.max_brightness = SKY81452_MAX_BRIGHTNESS,
> +	name = pdata->name ? pdata->name : SKY81452_DEFAULT_NAME;
> +	bd = devm_backlight_device_register(dev, name, dev, regmap,
> +						&sky81452_bl_ops, &props);
> +	if (IS_ERR(bd)) {
> +		dev_err(dev, "failed to register. err=%ld\n", PTR_ERR(bd));
> +		return PTR_ERR(bd);
> +	}
> +
> +	platform_set_drvdata(pdev, bd);
> +
> +	ret  = sysfs_create_group(&bd->dev.kobj, &sky81452_bl_attr_group);
> +	if (IS_ERR_VALUE(ret)) {
> +		dev_err(dev, "failed to create attribute. err=%d\n", ret);
> +		return ret;
> +	}
> +
> +	return ret;
> +}
> +
> +static int sky81452_bl_remove(struct platform_device *pdev)
> +{
> +	const struct sky81452_bl_platform_data *pdata > +						dev_get_platdata(&pdev->dev);
> +	struct backlight_device *bd = platform_get_drvdata(pdev);
> +
> +	sysfs_remove_group(&bd->dev.kobj, &sky81452_bl_attr_group);
> +
> +	bd->props.power = FB_BLANK_UNBLANK;
> +	bd->props.brightness = 0;
> +	backlight_update_status(bd);
> +
> +	if (gpio_is_valid(pdata->gpio_enable))
> +		gpio_set_value_cansleep(pdata->gpio_enable, 0);
> +
> +	return 0;
> +}
> +
> +#ifdef CONFIG_OF
> +static const struct of_device_id sky81452_bl_of_match[] = {
> +	{ .compatible = "skyworks,sky81452-backlight", },
> +	{ }
> +};
> +MODULE_DEVICE_TABLE(of, sky81452_bl_of_match);
> +#endif
> +
> +static struct platform_driver sky81452_bl_driver = {
> +	.driver = {
> +		.name = "sky81452-backlight",
> +		.of_match_table = of_match_ptr(sky81452_bl_of_match),
> +	},
> +	.probe = sky81452_bl_probe,
> +	.remove = sky81452_bl_remove,
> +};
> +
> +module_platform_driver(sky81452_bl_driver);
> +
> +MODULE_DESCRIPTION("Skyworks SKY81452 backlight driver");
> +MODULE_AUTHOR("Gyungoh Yoo <jack.yoo@skyworksinc.com>");
> +MODULE_LICENSE("GPL v2");
> diff --git a/include/linux/platform_data/sky81452-backlight.h b/include/linux/platform_data/sky81452-backlight.h
> new file mode 100644
> index 0000000..1231e9b
> --- /dev/null
> +++ b/include/linux/platform_data/sky81452-backlight.h
> @@ -0,0 +1,46 @@
> +/*
> + * sky81452.h	SKY81452 backlight driver
> + *
> + * Copyright 2014 Skyworks Solutions Inc.
> + * Author : Gyungoh Yoo <jack.yoo@skyworksinc.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.
> + *
> + * 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.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef _SKY81452_BACKLIGHT_H
> +#define _SKY81452_BACKLIGHT_H
> +
> +/**
> + * struct sky81452_platform_data
> + * @name:	backlight driver name.
> +		If it is not defined, default name is lcd-backlight.
> + * @gpio_enable:GPIO number which control EN pin
> + * @enable:	Enable mask for current sink channel 1, 2, 3, 4, 5 and 6.
> + * @ignore_pwm:	true if DPWMI should be ignored.
> + * @dpwm_mode:	true is DPWM dimming mode, otherwise Analog dimming mode.
> + * @phase_shift:true is phase shift mode.
> + * @short_detecion_threshold:	It should be one of 4, 5, 6 and 7V.
> + * @boost_current_limit:	It should be one of 2300, 2750mA.
> + */
> +struct sky81452_bl_platform_data {
> +	const char *name;
> +	int gpio_enable;
> +	unsigned int enable;
> +	bool ignore_pwm;
> +	bool dpwm_mode;
> +	bool phase_shift;
> +	unsigned int short_detection_threshold;
> +	unsigned int boost_current_limit;
> +};
> +
> +#endif

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v11 3/6] devicetree: Add new SKY81452 mfd binding
From: Lee Jones @ 2015-03-09  9:40 UTC (permalink / raw)
  To: gyungoh-Re5JQEeQqe8AvxtiuMwx3w
  Cc: sameo-VuQAYsv1563Yd54FQh9/CA, robh+dt-DgEjT+Ai2ygdnm+yROfE0A,
	jg1.han-Sze3O3UU22JBDgjK7y7TUQ, pawel.moll-5wv7dgnIgG8,
	mark.rutland-5wv7dgnIgG8, ijc+devicetree-KcIKpvwj1kUDXYZnReoRVg,
	galak-sgV2jX0FEOL9JmXXK+q4OQ, trivial-DgEjT+Ai2ygdnm+yROfE0A,
	broonie-DgEjT+Ai2ygdnm+yROfE0A, florian.vaussard-p8DiymsW2f8,
	andrew-g2DYL2Zd6BY, antonynpavlov-Re5JQEeQqe8AvxtiuMwx3w,
	hytszk-Re5JQEeQqe8AvxtiuMwx3w, plagnioj-sclMFOaUSTBWk0Htik3J/w,
	tomi.valkeinen-l0cyMroinI0, jack.yoo-tjhQNA90jdKqndwCJWfcng,
	linux-fbdev-u79uwXL29TY76Z2rM5mHXA,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA,
	devicetree-u79uwXL29TY76Z2rM5mHXA, treding-DDmLM1+adcrQT0dZR+AlfA,
	p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ, arno-LkuqDEemtHBg9hUCZPvPmw,
	kuninori.morimoto.gx-zM6kxYcvzFBBDgjK7y7TUQ
In-Reply-To: <1425019346-4559-4-git-send-email-jack.yoo-tjhQNA90jdKqndwCJWfcng@public.gmane.org>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> ---
> Changes v11:
> Renamed 'skyworks,en-channels' property to led-sources.
> Removed unused property 'skyworks,ovp-level'.
> 
> Changes v10:
> Nothing
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Made up the example for backlight DT
> 
> Changes v7:
> Nothing
> 
> Changes v6:
> Nothing
> 
> Changes v5:
> Changed DT for regulator : 'lout' node should be defined under 'regulator'
> Removed compatible string from sky81452-regulator driver
> 
> Changes v4:
> Nothing
> 
> Changes v3:
> Nothing
> 
> Changes v2:
> Added reg attribute for I2C slave address
> 
>  Documentation/devicetree/bindings/mfd/sky81452.txt | 35 ++++++++++++++++++++++
>  1 file changed, 35 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/mfd/sky81452.txt
> 
> diff --git a/Documentation/devicetree/bindings/mfd/sky81452.txt b/Documentation/devicetree/bindings/mfd/sky81452.txt
> new file mode 100644
> index 0000000..3518179
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/mfd/sky81452.txt
> @@ -0,0 +1,35 @@
> +SKY81452 bindings
> +
> +Required properties:
> +- compatible	: Must be "skyworks,sky81452"
> +- reg		: I2C slave address
> +
> +Required child nodes:
> +- backlight	: container node for backlight following the binding
> +		in video/backlight/sky81452-backlight.txt
> +- regulator	: container node for regulators following the binding
> +		in regulator/sky81452-regulator.txt
> +
> +Example:
> +
> +	sky81452@2c {
> +		compatible = "skyworks,sky81452";
> +		reg = <0x2c>;
> +
> +		backlight {
> +			compatible = "skyworks,sky81452-backlight";
> +			name = "pwm-backlight";
> +			led-sources = <0 1 2 3 6>;
> +			skyworks,ignore-pwm;
> +			skyworks,phase-shift;
> +			skyworks,current-limit = <2300>;
> +		};
> +
> +		regulator {
> +			lout {
> +				regulator-name = "sky81452-lout";
> +				regulator-min-microvolt = <4500000>;
> +				regulator-max-microvolt = <8000000>;
> +			};
> +		};
> +	};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v11 4/6] devicetree: Add new SKY81452 backlight binding
From: Lee Jones @ 2015-03-09  9:40 UTC (permalink / raw)
  To: gyungoh
  Cc: sameo, robh+dt, jg1.han, pawel.moll, mark.rutland, ijc+devicetree,
	galak, trivial, broonie, florian.vaussard, andrew, antonynpavlov,
	hytszk, plagnioj, tomi.valkeinen, jack.yoo, linux-fbdev,
	linux-kernel, devicetree, treding, p.zabel, arno,
	kuninori.morimoto.gx
In-Reply-To: <1425019346-4559-5-git-send-email-jack.yoo@skyworksinc.com>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Bryan Wu <cooloney@gmail.com>
> ---
> Changes v11:
> Renamed 'skyworks,en-channels' property to led-sources.
> Removed unused property 'skyworks,ovp-level'.
> 
> Changes v10:
> Nothing
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Renamed property names for backlight with vendor prefix
> Modified gpio-enable property to generic property for GPIO
> Made up the example for backlight DT
> 
> Changes v7:
> Nothing
> 
> Changes v6:
> Nothing
> 
> Changes v5:
> Nothing
> 
> Changes v4:
> Nothing
> 
> Changes v3:
> Nothing
> 
> Changes v2:
> Added reg attribute for I2C slave address
> 
>  .../video/backlight/sky81452-backlight.txt         | 29 ++++++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> 
> diff --git a/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> new file mode 100644
> index 0000000..8bf2940
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/video/backlight/sky81452-backlight.txt
> @@ -0,0 +1,29 @@
> +SKY81452-backlight bindings
> +
> +Required properties:
> +- compatible		: Must be "skyworks,sky81452-backlight"
> +
> +Optional properties:
> +- name			: Name of backlight device. Default is 'lcd-backlight'.
> +- gpios			: GPIO to use to EN pin.
> +			See Documentation/devicetree/bindings/gpio/gpio.txt
> +- led-sources		: List of enabled channels from 0 to 5.
> +			See Documentation/devicetree/bindings/leds/common.txt
> +- skyworks,ignore-pwm	: Ignore both PWM input
> +- skyworks,dpwm-mode	: Enable DPWM dimming mode, otherwise Analog dimming.
> +- skyworks,phase-shift	: Enable phase shift mode
> +- skyworks,short-detection-threshold-volt
> +			: It should be one of 4, 5, 6 and 7V.
> +- skyworks,current-limit-mA
> +			: It should be 2300mA or 2750mA.
> +
> +Example:
> +
> +	backlight {
> +		compatible = "skyworks,sky81452-backlight";
> +		name = "pwm-backlight";
> +		led-sources = <0 1 2 5>;
> +		skyworks,ignore-pwm;
> +		skyworks,phase-shift;
> +		skyworks,current-limit-mA = <2300>;
> +	};

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v11 5/6] devicetree: Add vendor prefix for Skyworks Solutions, Inc.
From: Lee Jones @ 2015-03-09  9:41 UTC (permalink / raw)
  To: gyungoh
  Cc: sameo, robh+dt, jg1.han, pawel.moll, mark.rutland, ijc+devicetree,
	galak, trivial, broonie, florian.vaussard, andrew, antonynpavlov,
	hytszk, plagnioj, tomi.valkeinen, jack.yoo, linux-fbdev,
	linux-kernel, devicetree, treding, p.zabel, arno,
	kuninori.morimoto.gx
In-Reply-To: <1425019346-4559-6-git-send-email-jack.yoo@skyworksinc.com>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> Acked-by: Lee Jones <lee.jones@linaro.org>
> ---
> Changes v11:
> Nothing
> 
> Changes v10:
> Nothing
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Nothing
> 
> Changes v7:
> Nothing
> 
> Changes v6:
> Nothing
> 
> Changes v5:
> Nothing
> 
> Changes v4:
> Nothing
> 
> Changes v3:
> Nothing
> 
> Changes v2:
> Added vendor prefix for Skyworks Solutions, Inc.
> 
>  Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
> index 389ca13..c4fe9cc 100644
> --- a/Documentation/devicetree/bindings/vendor-prefixes.txt
> +++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
> @@ -165,6 +165,7 @@ sii	Seiko Instruments, Inc.
>  silergy	Silergy Corp.
>  sirf	SiRF Technology, Inc.
>  sitronix	Sitronix Technology Corporation
> +skyworks	Skyworks Solutions, Inc.
>  smsc	Standard Microsystems Corporation
>  snps	Synopsys, Inc.
>  solidrun	SolidRun

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH v11 6/6] devicetree: Add SKY81452 to the Trivial Devices list
From: Lee Jones @ 2015-03-09  9:41 UTC (permalink / raw)
  To: gyungoh
  Cc: sameo, robh+dt, jg1.han, pawel.moll, mark.rutland, ijc+devicetree,
	galak, trivial, broonie, florian.vaussard, andrew, antonynpavlov,
	hytszk, plagnioj, tomi.valkeinen, jack.yoo, linux-fbdev,
	linux-kernel, devicetree, treding, p.zabel, arno,
	kuninori.morimoto.gx
In-Reply-To: <1425019346-4559-7-git-send-email-jack.yoo@skyworksinc.com>

Applied, thanks.

On Fri, 27 Feb 2015, gyungoh@gmail.com wrote:

> From: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> 
> Signed-off-by: Gyungoh Yoo <jack.yoo@skyworksinc.com>
> ---
> Changes v11:
> Nothing
> 
> Changes v10:
> Nothing
> 
> Changes v9:
> Nothing
> 
> Changes v8:
> Nothing
> 
> Changes v7:
> Nothing
> 
> Changes v6:
> Nothing
> 
> Changes v5:
> Nothing
> 
> Changes v4:
> Nothing
> 
> Changes v3:
> Nothing
> 
> Changes v2:
> Add SKY81452 to the Trivial Devices list
> 
>  Documentation/devicetree/bindings/i2c/trivial-devices.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/i2c/trivial-devices.txt b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> index aaa8325..003bd77 100644
> --- a/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> +++ b/Documentation/devicetree/bindings/i2c/trivial-devices.txt
> @@ -89,6 +89,7 @@ ricoh,rv5c386		I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>  ricoh,rv5c387a		I2C bus SERIAL INTERFACE REAL-TIME CLOCK IC
>  samsung,24ad0xd1	S524AD0XF1 (128K/256K-bit Serial EEPROM for Low Power)
>  sii,s35390a		2-wire CMOS real-time clock
> +skyworks,sky81452	Skyworks SKY81452: Six-Channel White LED Driver with Touch Panel Bias Supply
>  st-micro,24c256		i2c serial eeprom  (24cxx)
>  stm,m41t00		Serial Access TIMEKEEPER
>  stm,m41t62		Serial real-time clock (RTC) with alarm

-- 
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

^ permalink raw reply

* Re: [PATCH 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-09  9:47 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309092209.GB10964@mwanda>

On Mon, Mar 09, 2015 at 12:22:09PM +0300, Dan Carpenter wrote:
> On Sun, Mar 08, 2015 at 06:01:23PM +0530, Sudip Mukherjee wrote:
> > diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
> > index 711676c..2ab7b74 100644
> > --- a/drivers/staging/sm750fb/sm750.h
> > +++ b/drivers/staging/sm750fb/sm750.h
> > @@ -59,10 +59,10 @@ struct lynx_share{
> >  		}mtrr;
> >  #endif
> >  	/* all smi graphic adaptor got below attributes */
> > -	resource_size_t vidmem_start;
> > -	resource_size_t vidreg_start;
> > -	resource_size_t vidmem_size;
> > -	resource_size_t vidreg_size;
> > +	unsigned long vidmem_start;
> > +	unsigned long vidreg_start;
> > +	unsigned long vidmem_size;
> > +	unsigned long vidreg_size;
> >  	volatile unsigned char __iomem * pvReg;
> >  	unsigned char __iomem * pvMem;
> >  	/* locks*/
> 
> This seems like a very risky sort of change.  It's not explained very
> well in the changelog.  What's the deal?
it mainly started with the build warnings of incorrect format specifier.

v2 gives a little more details in the comments section. copying that here for your convenience:

"V2: Giedrius commented resource_size_t can be either u64 or u32
depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i
should have kept the datatype as resource_size_t and  used %pa as the
format specifier. But since this is a framebuffer device and it
should follow what the framebuffer layer is suggesting in
struct fb_fix_screeninfo at smem_start and mmio_start."

so accoringly, like all other framebuffer devices, vidmem_start and vidreg_start should be unsigned long and vidmem_size and vidreg_size should be __u32.


regards
sudip
> 
> regards,
> dan carpenter
> 

^ permalink raw reply

* Re: [PATCH v2 1/4] staging: sm750fb: wrong type for print
From: Dan Carpenter @ 2015-03-09 11:53 UTC (permalink / raw)
  To: Sudip Mukherjee
  Cc: Tomi Valkeinen, Greg Kroah-Hartman, devel, linux-fbdev,
	linux-kernel
In-Reply-To: <1425886506-8643-1-git-send-email-sudipm.mukherjee@gmail.com>

On Mon, Mar 09, 2015 at 01:05:03PM +0530, Sudip Mukherjee wrote:
> mention correct format specifier while printing.
> fixes all the build warnings about incorrect argument type while
> printing.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> ---
> 
> V2: Giedrius commented resource_size_t can be either u64 or u32
> depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i
> should have kept the datatype as resource_size_t and  used %pa as the
> format specifier. But since this is a framebuffer device and it
> should follow what the framebuffer layer is suggesting in
> struct fb_fix_screeninfo at smem_start and mmio_start.
> adding Tomi for his comments.


This should all have gone into the changelog because it changes how the
code works.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH v2 1/4] staging: sm750fb: wrong type for print
From: Sudip Mukherjee @ 2015-03-09 12:23 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Tomi Valkeinen, Greg Kroah-Hartman, devel, linux-fbdev,
	linux-kernel
In-Reply-To: <20150309115337.GD10964@mwanda>

On Mon, Mar 09, 2015 at 02:53:37PM +0300, Dan Carpenter wrote:
> On Mon, Mar 09, 2015 at 01:05:03PM +0530, Sudip Mukherjee wrote:
> > 
> > V2: Giedrius commented resource_size_t can be either u64 or u32
> > depending on if CONFIG_PHYS_ADDR_T_64BIT. based on his comments i
> > should have kept the datatype as resource_size_t and  used %pa as the
> > format specifier. But since this is a framebuffer device and it
> > should follow what the framebuffer layer is suggesting in
> > struct fb_fix_screeninfo at smem_start and mmio_start.
> > adding Tomi for his comments.
> 
> 
> This should all have gone into the changelog because it changes how the
> code works.

ok, then should i send a v3 of only this patch or the whole series?

regards
sudip

> 
> regards,
> dan carpenter
> 

^ permalink raw reply

* Re: [PATCH v2 4/4] staging: sm750fb: fix undeclared function
From: Dan Carpenter @ 2015-03-09 12:42 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <1425886506-8643-4-git-send-email-sudipm.mukherjee@gmail.com>

On Mon, Mar 09, 2015 at 01:05:06PM +0530, Sudip Mukherjee wrote:
> kbuild test robot reported that for microblaze-allyesconfig
> chan_to_field() and lynxfb_ops_set_par() were not defined. These two
> functions were defined under CONFIG_PM, so for any archtecture if
> CONFIG_PM is not defined we will have this error.
> 
> while moving the lynxfb_suspend() function some very obvious
> checkpatch errors, like space after comma, space after if, space
> before opening brace, were taken care of.

I have a script to review patches moving functions around but these
white space changes break my script so I have to review it by hand.
Sucks.

>  static int lynxfb_ops_set_par(struct fb_info * info)
>  {
>  	struct lynxfb_par * par;
> @@ -369,7 +313,6 @@ static int lynxfb_ops_set_par(struct fb_info * info)
>  	struct fb_fix_screeninfo * fix;
>  	int ret;
>  	unsigned int line_length;
> -	
>  
>  	if(!info)
>  		return -EINVAL;
> @@ -441,6 +384,7 @@ static int lynxfb_ops_set_par(struct fb_info * info)
>  		ret = output->proc_setMode(output,var,fix);
>  	return ret;
>  }
> +
>  static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf)
>  {
>  	chan &= 0xffff;

These white space changes are not related.

regards,
dan carpenter


^ permalink raw reply

* [GIT PULL] fbdev fixes for 4.0
From: Tomi Valkeinen @ 2015-03-09 12:49 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Linux Fbdev development list, LKML

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

Hi Linus,

Please pull fbdev fixes:

The following changes since commit c517d838eb7d07bbe9507871fab3931deccff539:

  Linux 4.0-rc1 (2015-02-22 18:21:14 -0800)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux.git tags/fbdev-fixes-4.0

for you to fetch changes up to a38bb793eaebe1178fbd8ef6ab66ccc062bad505:

  OMAPDSS: fix regression with display sysfs files (2015-02-26 10:23:15 +0200)

----------------------------------------------------------------
fbdev fixes for 4.0

* Fix regression in with omapdss when using i2c displays
* Fix possible null deref in fbmon
* Check kalloc return value in AMBA CLCD

----------------------------------------------------------------
Kiran Padwal (1):
      video: ARM CLCD: Add missing error check for devm_kzalloc

Sudip Mukherjee (1):
      video: fbdev: fix possible null dereference

Tomi Valkeinen (1):
      OMAPDSS: fix regression with display sysfs files

 drivers/video/fbdev/amba-clcd.c               |   3 +
 drivers/video/fbdev/core/fbmon.c              |   6 +-
 drivers/video/fbdev/omap2/dss/display-sysfs.c | 179 ++++++++++++++------------
 include/video/omapdss.h                       |   1 +
 4 files changed, 102 insertions(+), 87 deletions(-)


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

^ permalink raw reply

* Re: [PATCH v2 4/4] staging: sm750fb: fix undeclared function
From: Sudip Mukherjee @ 2015-03-09 12:55 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309124222.GE10964@mwanda>

On Mon, Mar 09, 2015 at 03:42:22PM +0300, Dan Carpenter wrote:
> On Mon, Mar 09, 2015 at 01:05:06PM +0530, Sudip Mukherjee wrote:
> > kbuild test robot reported that for microblaze-allyesconfig
> > chan_to_field() and lynxfb_ops_set_par() were not defined. These two
> > functions were defined under CONFIG_PM, so for any archtecture if
> > CONFIG_PM is not defined we will have this error.
> > 
> > while moving the lynxfb_suspend() function some very obvious
> > checkpatch errors, like space after comma, space after if, space
> > before opening brace, were taken care of.
> 
> I have a script to review patches moving functions around but these
> white space changes break my script so I have to review it by hand.
> Sucks.

oops . sorry ..
> 
> >  static int lynxfb_ops_set_par(struct fb_info * info)
<snip>
> >  static inline unsigned int chan_to_field(unsigned int chan,struct fb_bitfield * bf)
> >  {
> >  	chan &= 0xffff;
> 
> These white space changes are not related.
if you want i can break it into multiple patches, so that reviewing can be easy and your script will not break :) .
Actually I thought, since this is a vendor crude driver there will be many such changes, so if i can combine some changes together then atleast the number of patches can be kept low and also i thought of clubbing these changes together as Joe Perches once told me "Don't get carried away with patch type separation" (reference: https://lkml.org/lkml/2015/1/1/2).

regards
sudip

> 
> regards,
> dan carpenter
> 

^ permalink raw reply

* Re: [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Dan Carpenter @ 2015-03-09 13:13 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <1425836411-15481-3-git-send-email-sudipm.mukherjee@gmail.com>

On Sun, Mar 08, 2015 at 11:10:11PM +0530, Sudip Mukherjee wrote:
> change return type of sm7xx_vga_setup() to void as we are not using
> the return type anywhere. if this function fails we fall back to the
> default configuration.
> 
> Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>

Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>

This patch is fine but if you wanted you could send a follow on which
set it to SCREEN_X_RES, SCREEN_Y_RES, SCREEN_BPP if there were no
options.  Then remove the "if (smtc_scr_info.lfb_width != 0) " condition
in smtcfb_pci_probe().

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH v2 4/4] staging: sm750fb: fix undeclared function
From: Dan Carpenter @ 2015-03-09 13:29 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: devel, Greg Kroah-Hartman, linux-fbdev, linux-kernel
In-Reply-To: <20150309125503.GB11724@sudip-PC>

On Mon, Mar 09, 2015 at 06:25:03PM +0530, Sudip Mukherjee wrote:
> Actually I thought, since this is a vendor crude driver there will be many such changes, so if i can combine some changes together then atleast the number of patches can be kept low and also i thought of clubbing these changes together as Joe Perches once told me "Don't get carried away with patch type separation" (reference: https://lkml.org/lkml/2015/1/1/2).

How to break up patches is more art than science.  I wouldn't have
complained about the minor extra white space changes except that I was
already going to email you about breaking my scripts.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Dan Carpenter @ 2015-03-09 13:38 UTC (permalink / raw)
  To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309133032.GA13002@sudip-PC>



On Mon, Mar 09, 2015 at 07:00:33PM +0530, Sudip Mukherjee wrote:
> On Mon, Mar 09, 2015 at 04:13:43PM +0300, Dan Carpenter wrote:
> > On Sun, Mar 08, 2015 at 11:10:11PM +0530, Sudip Mukherjee wrote:
> > > change return type of sm7xx_vga_setup() to void as we are not using
> > > the return type anywhere. if this function fails we fall back to the
> > > default configuration.
> > > 
> > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > 
> > Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> > 
> > This patch is fine but if you wanted you could send a follow on which
> > set it to SCREEN_X_RES, SCREEN_Y_RES, SCREEN_BPP if there were no
> > options.  Then remove the "if (smtc_scr_info.lfb_width != 0) " condition
> > in smtcfb_pci_probe().
> 
> yes, i could have. But actually I am thinking to totally remove this function and use more conventional fb_get_mode() in its places. But if i do so then the boot parameters will change. Currently it is like vga=sm712fb:0x301 but if i change it to use fb_get_mode() then the boot parameters will change to vga=sm712fb:640x480@60-8 , and that is why I am hesitating. But it will be more conventional to what all framebuffer drivers follows.
> 

Hm...  That's a good question.

I suspect we should just go with fb_get_mode() and do it quickly.  This
driver is so new in the kernel that there are no users to get upset.

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Sudip Mukherjee @ 2015-03-09 13:42 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309131343.GG10964@mwanda>

On Mon, Mar 09, 2015 at 04:13:43PM +0300, Dan Carpenter wrote:
> On Sun, Mar 08, 2015 at 11:10:11PM +0530, Sudip Mukherjee wrote:
> > change return type of sm7xx_vga_setup() to void as we are not using
> > the return type anywhere. if this function fails we fall back to the
> > default configuration.
> > 
> > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> 
> Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> 
> This patch is fine but if you wanted you could send a follow on which
> set it to SCREEN_X_RES, SCREEN_Y_RES, SCREEN_BPP if there were no
> options.  Then remove the "if (smtc_scr_info.lfb_width != 0) " condition
> in smtcfb_pci_probe().

yes, i could have. But actually I am thinking to totally remove this function and use more conventional fb_get_mode() in its places. But if i do so then the boot parameters will change. Currently it is like vga=sm712fb:0x301 but if i change it to use fb_get_mode() then the boot parameters will change to vga=sm712fb:640x480@60-8 , and that is why I am hesitating. But it will be more conventional to what all framebuffer drivers follows.

regards
sudip

> 
> regards,
> dan carpenter
> 

^ permalink raw reply

* Re: [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Sudip Mukherjee @ 2015-03-09 13:53 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: Greg Kroah-Hartman, devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309133805.GI10964@mwanda>

On Mon, Mar 09, 2015 at 04:38:05PM +0300, Dan Carpenter wrote:
> 
> 
> On Mon, Mar 09, 2015 at 07:00:33PM +0530, Sudip Mukherjee wrote:
> > On Mon, Mar 09, 2015 at 04:13:43PM +0300, Dan Carpenter wrote:
> > > On Sun, Mar 08, 2015 at 11:10:11PM +0530, Sudip Mukherjee wrote:
> > > > change return type of sm7xx_vga_setup() to void as we are not using
> > > > the return type anywhere. if this function fails we fall back to the
> > > > default configuration.
> > > > 
> > > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > > 
> > > Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > 
> > > This patch is fine but if you wanted you could send a follow on which
> > > set it to SCREEN_X_RES, SCREEN_Y_RES, SCREEN_BPP if there were no
> > > options.  Then remove the "if (smtc_scr_info.lfb_width != 0) " condition
> > > in smtcfb_pci_probe().
> > 
> > yes, i could have. But actually I am thinking to totally remove this function and use more conventional fb_get_mode() in its places. But if i do so then the boot parameters will change. Currently it is like vga=sm712fb:0x301 but if i change it to use fb_get_mode() then the boot parameters will change to vga=sm712fb:640x480@60-8 , and that is why I am hesitating. But it will be more conventional to what all framebuffer drivers follows.
> > 
> 
> Hm...  That's a good question.
> 
> I suspect we should just go with fb_get_mode() and do it quickly.  This
> driver is so new in the kernel that there are no users to get upset.
i am afraid that is not correct. this driver was in staging from long back, and Greg removed it from staging as no one was working with it. But after that removal Lemote Yeeloong laptop of Steven Rostedt stopped working. (https://lkml.org/lkml/2014/11/20/698) , so i guess there will be many such users.

regards
sudip

> 
> regards,
> dan carpenter
> 

^ permalink raw reply

* Re: [PATCH 3/3] staging: sm7xxfb: change return of sm7xx_vga_setup
From: Dan Carpenter @ 2015-03-09 14:04 UTC (permalink / raw)
  To: Sudip Mukherjee, Greg Kroah-Hartman; +Cc: devel, linux-fbdev, linux-kernel
In-Reply-To: <20150309135343.GC13002@sudip-PC>

On Mon, Mar 09, 2015 at 07:23:43PM +0530, Sudip Mukherjee wrote:
> On Mon, Mar 09, 2015 at 04:38:05PM +0300, Dan Carpenter wrote:
> > 
> > 
> > On Mon, Mar 09, 2015 at 07:00:33PM +0530, Sudip Mukherjee wrote:
> > > On Mon, Mar 09, 2015 at 04:13:43PM +0300, Dan Carpenter wrote:
> > > > On Sun, Mar 08, 2015 at 11:10:11PM +0530, Sudip Mukherjee wrote:
> > > > > change return type of sm7xx_vga_setup() to void as we are not using
> > > > > the return type anywhere. if this function fails we fall back to the
> > > > > default configuration.
> > > > > 
> > > > > Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> > > > 
> > > > Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
> > > > 
> > > > This patch is fine but if you wanted you could send a follow on which
> > > > set it to SCREEN_X_RES, SCREEN_Y_RES, SCREEN_BPP if there were no
> > > > options.  Then remove the "if (smtc_scr_info.lfb_width != 0) " condition
> > > > in smtcfb_pci_probe().
> > > 
> > > yes, i could have. But actually I am thinking to totally remove this function and use more conventional fb_get_mode() in its places. But if i do so then the boot parameters will change. Currently it is like vga=sm712fb:0x301 but if i change it to use fb_get_mode() then the boot parameters will change to vga=sm712fb:640x480@60-8 , and that is why I am hesitating. But it will be more conventional to what all framebuffer drivers follows.
> > > 
> > 
> > Hm...  That's a good question.
> > 
> > I suspect we should just go with fb_get_mode() and do it quickly.  This
> > driver is so new in the kernel that there are no users to get upset.
>
> i am afraid that is not correct. this driver was in staging from long
> back, and Greg removed it from staging as no one was working with it.
> But after that removal Lemote Yeeloong laptop of Steven Rostedt
> stopped working. (https://lkml.org/lkml/2014/11/20/698) , so i guess
> there will be many such users.

Hm...  I suspect we should still change it so it matches the other FB
drivers but I don't know.

Perhaps Greg has an opinion?

regards,
dan carpenter


^ permalink raw reply

* Re: [PATCH] video: ARM CLCD: Added dt support to set tim2 register
From: Russell King - ARM Linux @ 2015-03-09 16:16 UTC (permalink / raw)
  To: Pawel Moll
  Cc: Arun Ramamurthy, Rob Herring, Mark Rutland, Ian Campbell,
	Kumar Gala, Jean-Christophe Plagniol-Villard, Tomi Valkeinen,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-fbdev@vger.kernel.org, Dmitry Torokhov, Anatol Pomazau,
	Jonathan Richardson, Scott Branden, Ray Jui,
	bcm-kernel-feedback-list@broadcom.com
In-Reply-To: <1425378127.3092.38.camel@arm.com>

On Tue, Mar 03, 2015 at 10:22:07AM +0000, Pawel Moll wrote:
> On Tue, 2015-03-03 at 10:02 +0000, Pawel Moll wrote:
> > On Mon, 2015-03-02 at 19:09 +0000, Arun Ramamurthy wrote:
> > > > The existing bindings intentionally avoided quoting internal registers -
> > > > they are supposed to describe how the hardware is wired up...
> > > >
> > > > So how about something like "arm,pl11x,tft-invert-clac"? Then the driver
> > > > sets the bit or not, depending on the property existance?
> > > >
> > > Sure, I can change it to two properties called arm,pl11x,tft-invert-clac 
> > > and arm,pl11x,tft-clksel. Would that be acceptable?
> > 
> > That would be fine by me :-)
> 
> Or (after having a look at the TRM) I should rather say: the invert-clac
> is fine by me :-) but the tft-clksel doesn't work, I afraid.
> 
> If I'm not mistaken, there are two problems with it.
> 
> Number one: it's not TFT-specific, is it? So it certainly should not
> have the "tft-" bit.
> 
> Number two: setting this bit says "do not use CLCDCLK for the logic; use
> HCLK instead", correct? If so, have a look at the clock properties. They
> say:
> 
> - clock-names: should contain "clcdclk" and "apb_pclk"
> 
> - clocks: contains phandle and clock specifier pairs for the entries
>         in the clock-names property. See
> 
> So if your hardware has the reference clock wired to HCLK, and you
> defining the clocks as "clcdclk", you are (no offence meant ;-)
> lying :-)

No.  The CLCD block always takes two clock signals - the AHB bus clock
(HCLK) for the slave interface, and a CLCD clock.

The CLCDCLKSEL is a bit which affects a signal sent to the world outside
of the CLCD block, which is used to drive an _external_ multiplexer to
select the CLCD clock source.  (See the description for bit 5 of the
LCDTiming2 register.)

So, the clock is still input to the CLCDCLK input, even if it is ultimately
derived from HCLK.

Remember, the clock API does not deal with names describing the source of
the clock, but the consumer of the clock.  The consumer in this case is
the PL11x CLCD block, which takes a CLCDCLK input.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

^ permalink raw reply

* [PATCH] staging: sm750fb: Fix sparse warning
From: Lorenzo Stoakes @ 2015-03-09 20:57 UTC (permalink / raw)
  To: sudipm.mukherjee, teddy.wang, gregkh
  Cc: linux-fbdev, devel, linux-kernel, Lorenzo Stoakes

This patch fixes the following sparse warning:-

drivers/staging/sm750fb/ddk750_help.c: warning: incorrect type in assignment (different address spaces)

Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
---
 drivers/staging/sm750fb/ddk750_chip.h | 4 +++-
 drivers/staging/sm750fb/ddk750_help.c | 2 +-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_chip.h b/drivers/staging/sm750fb/ddk750_chip.h
index 1c78875..a4e5bcc 100644
--- a/drivers/staging/sm750fb/ddk750_chip.h
+++ b/drivers/staging/sm750fb/ddk750_chip.h
@@ -3,6 +3,8 @@
 #define DEFAULT_INPUT_CLOCK 14318181 /* Default reference clock */
 #define SM750LE_REVISION_ID (char)0xfe
 
+#include <asm/io.h>
+
 /* This is all the chips recognized by this library */
 typedef enum _logical_chip_type_t
 {
@@ -70,7 +72,7 @@ logical_chip_type_t getChipType(void);
 unsigned int calcPllValue(unsigned int request,pll_value_t *pll);
 unsigned int calcPllValue2(unsigned int,pll_value_t *);
 unsigned int formatPllReg(pll_value_t *pPLL);
-void ddk750_set_mmio(volatile unsigned char *,unsigned short,char);
+void ddk750_set_mmio(volatile unsigned char __iomem *,unsigned short,char);
 unsigned int ddk750_getVMSize(void);
 int ddk750_initHw(initchip_param_t *);
 unsigned int getPllValue(clock_type_t clockType, pll_value_t *pPLL);
diff --git a/drivers/staging/sm750fb/ddk750_help.c b/drivers/staging/sm750fb/ddk750_help.c
index cc00d2b..6ad4dec 100644
--- a/drivers/staging/sm750fb/ddk750_help.c
+++ b/drivers/staging/sm750fb/ddk750_help.c
@@ -7,7 +7,7 @@ char revId750 = 0;
 unsigned short devId750 = 0;
 
 /* after driver mapped io registers, use this function first */
-void ddk750_set_mmio(volatile unsigned char * addr,unsigned short devId,char revId)
+void ddk750_set_mmio(volatile unsigned char __iomem * addr,unsigned short devId,char revId)
 {
 	mmio750 = addr;
 	devId750 = devId;
-- 
2.3.2


^ permalink raw reply related

* [PATCHv3 00/10] fbdev: ssd1307fb: Cleanup and add support for SSD1305
From: Thomas Niederprüm @ 2015-03-09 22:22 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, maxime.ripard, kernel, shawn.guo,
	robh+dt
  Cc: linux-fbdev, linux-kernel, Thomas Niederprüm
In-Reply-To: <1423261694-5939-1-git-send-email-niederp@physik.uni-kl.de>

This patch series is the result of making the ssd1307fb driver work with
a Newhaven OLED display using the Solomon SSD1305 controller. To achieve
this the intialization code for the SSD1306 and the SSD1307 is merged
and based on DT configuration to reflect the various possible wirings
of the SSD130X controller (04/10). Based on these changes it is straight
forward to add support for the SSD1305 controller (06/10).

While working on the driver I realized that it was not possible to
correctly mmap the video memory from userspace since the address handed
to the userspace app is a virtual one where it should be a physical one.
Patch 01/10 fixes this. Furthermore the memory reserved by kzalloc is
not page aligned while the address handed to userspace is aligned to the
next page frame. This problem is fixed by using vmalloc in 02/10.

Furthermore module parameters are added to set the bits per pixel
and the delay for the deferred io update. It makes sense to set
the bits per pixel for the video memory to 8 bits since there is
only very poor userspace support for 1 bit framebuffers.

Also sysfs handles are added to make the contrast settings and dim
mode setting available in userspace.

changes since v1 (thanks to Maxime for the feedback):
- dedicated patch for fixing smem_start address
- remove page reserve upon vmalloc
- remove return value check upon display turn-off at module unload
- use a module parameter refreshrate rather than delaydivider
- allocate fbdefio dynamically
- use sysfs_create_groups to create sysfs entries
- remove contrast, vhcom and dclk properties from DT since they are
  not part of hw description. The contrast module parameter was added
  to set contrast at load time. vhcom and dclk stays at it's default
  values for now.
- add new DT properties to in tree users of ssd130X
- rebased to apply on top of linux-next

changes since v2 (thanks to Maxime again):
- free memory allocated by vmalloc on driver unload
- set default values in the init code to the ones of the existing ssd1307
  init code
- added two ACKs (Maxime Ripard)

Thomas Niederprüm (10):
  fbdev: ssd1307fb: fix memory address smem_start.
  fbdev: ssd1307fb: Use vmalloc to allocate video memory.
  of: Add Solomon Systech vendor prefix.
  fbdev: ssd1307fb: Unify init code and obtain hw specific bits from DT
  ARM: mxs: fix in tree users of ssd1306
  fbdev: ssd1307fb: Add support for SSD1305
  fbdev: ssd1307fb: Add module parameter to set refresh rate of the
    display
  fbdev: ssd1307fb: Add module parameter bitsperpixel.
  fbdev: ssd1307fb: Add sysfs handles to expose contrast and dim setting
    to userspace.
  fbdev: ssd1307fb: Turn off display on driver unload.

 .../devicetree/bindings/vendor-prefixes.txt        |   1 +
 .../devicetree/bindings/video/ssd1307fb.txt        |  23 +-
 arch/arm/boot/dts/imx28-cfa10036.dts               |   4 +
 drivers/video/fbdev/ssd1307fb.c                    | 355 +++++++++++++++------
 4 files changed, 286 insertions(+), 97 deletions(-)

-- 
2.3.0


^ permalink raw reply

* [PATCHv3 01/10] fbdev: ssd1307fb: fix memory address smem_start.
From: Thomas Niederprüm @ 2015-03-09 22:22 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, maxime.ripard, kernel, shawn.guo,
	robh+dt
  Cc: linux-fbdev, linux-kernel, Thomas Niederprüm
In-Reply-To: <1425939732-18386-1-git-send-email-niederp@physik.uni-kl.de>

the smem_start pointer of the framebuffer info struct needs to hold the
physical address rather than the virtual address. This patch fixes a
driver crash on mmaping the framebuffer memory due to an access to the
memory address.

Note however that the memory allocated by kzalloc is not page aligned,
while the address presented on a mmap call is aligned to the next page
boudary.

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com>
---
 drivers/video/fbdev/ssd1307fb.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index f7ed6d9..61e0ce8 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -515,7 +515,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 	info->var.blue.offset = 0;
 
 	info->screen_base = (u8 __force __iomem *)vmem;
-	info->fix.smem_start = (unsigned long)vmem;
+	info->fix.smem_start = __pa(vmem);
 	info->fix.smem_len = vmem_size;
 
 	fb_deferred_io_init(info);
-- 
2.3.0


^ permalink raw reply related

* [PATCHv3 02/10] fbdev: ssd1307fb: Use vmalloc to allocate video memory.
From: Thomas Niederprüm @ 2015-03-09 22:22 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, maxime.ripard, kernel, shawn.guo,
	robh+dt
  Cc: linux-fbdev, linux-kernel, Thomas Niederprüm
In-Reply-To: <1425939732-18386-1-git-send-email-niederp@physik.uni-kl.de>

It makes sense to use vmalloc to allocate the video buffer since it has to be
page aligned memory for using it with mmap. Also deffered io seems buggy in
combination with kmalloc'ed memory (crash on unloading the module).

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
---
 drivers/video/fbdev/ssd1307fb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/video/fbdev/ssd1307fb.c b/drivers/video/fbdev/ssd1307fb.c
index 61e0ce8..310474a 100644
--- a/drivers/video/fbdev/ssd1307fb.c
+++ b/drivers/video/fbdev/ssd1307fb.c
@@ -11,6 +11,7 @@
 #include <linux/i2c.h>
 #include <linux/fb.h>
 #include <linux/uaccess.h>
+#include <linux/vmalloc.h>
 #include <linux/of_device.h>
 #include <linux/of_gpio.h>
 #include <linux/pwm.h>
@@ -489,7 +490,7 @@ static int ssd1307fb_probe(struct i2c_client *client,
 
 	vmem_size = par->width * par->height / 8;
 
-	vmem = devm_kzalloc(&client->dev, vmem_size, GFP_KERNEL);
+	vmem = vzalloc(vmem_size);
 	if (!vmem) {
 		dev_err(&client->dev, "Couldn't allocate graphical memory.\n");
 		ret = -ENOMEM;
@@ -559,6 +560,7 @@ panel_init_error:
 		par->ops->remove(par);
 reset_oled_error:
 	fb_deferred_io_cleanup(info);
+	vfree(vmem);
 fb_alloc_error:
 	framebuffer_release(info);
 	return ret;
@@ -573,6 +575,7 @@ static int ssd1307fb_remove(struct i2c_client *client)
 	if (par->ops->remove)
 		par->ops->remove(par);
 	fb_deferred_io_cleanup(info);
+	vfree(__va(info->fix.smem_start));
 	framebuffer_release(info);
 
 	return 0;
-- 
2.3.0


^ permalink raw reply related

* [PATCHv3 03/10] of: Add Solomon Systech vendor prefix.
From: Thomas Niederprüm @ 2015-03-09 22:22 UTC (permalink / raw)
  To: plagnioj, tomi.valkeinen, maxime.ripard, kernel, shawn.guo,
	robh+dt
  Cc: linux-fbdev, linux-kernel, Thomas Niederprüm
In-Reply-To: <1425939732-18386-1-git-send-email-niederp@physik.uni-kl.de>

This patch adds the solomon prefix for Solomon Systech Limited.

Signed-off-by: Thomas Niederprüm <niederp@physik.uni-kl.de>
---
 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt
index d3f4809..933c8f5 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -169,6 +169,7 @@ sitronix	Sitronix Technology Corporation
 smsc	Standard Microsystems Corporation
 snps	Synopsys, Inc.
 solidrun	SolidRun
+solomon        Solomon Systech Limited
 sony	Sony Corporation
 spansion	Spansion Inc.
 sprd	Spreadtrum Communications Inc.
-- 
2.3.0


^ permalink raw reply related


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