All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org,
	alsa-devel@alsa-project.org
Cc: Andrea Adami <andrea.adami@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
	Jingoo Han <jg1.han@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 07/15] video: backlight: drop old locomo bl/lcd driver
Date: Tue, 28 Oct 2014 03:02:00 +0300	[thread overview]
Message-ID: <1414454528-24240-8-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1414454528-24240-1-git-send-email-dbaryshkov@gmail.com>

Old locomolcd driver is now completely obsolete by new locomo_bl and
locomo_lcd drivers, so let's drop it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/video/backlight/locomolcd.c | 255 ------------------------------------
 1 file changed, 255 deletions(-)
 delete mode 100644 drivers/video/backlight/locomolcd.c

diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
deleted file mode 100644
index 6c3ec42..0000000
--- a/drivers/video/backlight/locomolcd.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Backlight control code for Sharp Zaurus SL-5500
- *
- * Copyright 2005 John Lenz <lenz@cs.wisc.edu>
- * Maintainer: Pavel Machek <pavel@ucw.cz> (unless John wants to :-)
- * GPL v2
- *
- * This driver assumes single CPU. That's okay, because collie is
- * slightly old hardware, and no one is going to retrofit second CPU to
- * old PDA.
- */
-
-/* LCD power functions */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/fb.h>
-#include <linux/backlight.h>
-
-#include <asm/hardware/locomo.h>
-#include <asm/irq.h>
-#include <asm/mach/sharpsl_param.h>
-#include <asm/mach-types.h>
-
-#include "../../../arch/arm/mach-sa1100/generic.h"
-
-static struct backlight_device *locomolcd_bl_device;
-static struct locomo_dev *locomolcd_dev;
-static unsigned long locomolcd_flags;
-#define LOCOMOLCD_SUSPENDED     0x01
-
-static void locomolcd_on(int comadj)
-{
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 1);
-	mdelay(2);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 1);
-	mdelay(2);
-
-	locomo_m62332_senddata(locomolcd_dev, comadj, 0);
-	mdelay(5);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 1);
-	mdelay(10);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel(0x01, locomolcd_dev->mapbase + LOCOMO_TC);
-
-	/* Set CPSD */
-	locomo_writel(6, locomolcd_dev->mapbase + LOCOMO_CPSD);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel((0x04 | 0x01), locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(10);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 1);
-}
-
-static void locomolcd_off(int comadj)
-{
-	/* TFTCRST=1 | CPSOUT=1 | CPSEN = 0 */
-	locomo_writel(0x06, locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(1);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	mdelay(110);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	mdelay(700);
-
-	/* TFTCRST=0 | CPSOUT=0 | CPSEN = 0 */
-	locomo_writel(0, locomolcd_dev->mapbase + LOCOMO_TC);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-}
-
-void locomolcd_power(int on)
-{
-	int comadj = sharpsl_param.comadj;
-	unsigned long flags;
-
-	local_irq_save(flags);
-
-	if (!locomolcd_dev) {
-		local_irq_restore(flags);
-		return;
-	}
-
-	/* read comadj */
-	if (comadj == -1 && machine_is_collie())
-		comadj = 128;
-	if (comadj == -1 && machine_is_poodle())
-		comadj = 118;
-
-	if (on)
-		locomolcd_on(comadj);
-	else
-		locomolcd_off(comadj);
-
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(locomolcd_power);
-
-static int current_intensity;
-
-static int locomolcd_set_intensity(struct backlight_device *bd)
-{
-	int intensity = bd->props.brightness;
-
-	if (bd->props.power != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (locomolcd_flags & LOCOMOLCD_SUSPENDED)
-		intensity = 0;
-
-	switch (intensity) {
-	/*
-	 * AC and non-AC are handled differently,
-	 * but produce same results in sharp code?
-	 */
-	case 0:
-		locomo_frontlight_set(locomolcd_dev, 0, 0, 161);
-		break;
-	case 1:
-		locomo_frontlight_set(locomolcd_dev, 117, 0, 161);
-		break;
-	case 2:
-		locomo_frontlight_set(locomolcd_dev, 163, 0, 148);
-		break;
-	case 3:
-		locomo_frontlight_set(locomolcd_dev, 194, 0, 161);
-		break;
-	case 4:
-		locomo_frontlight_set(locomolcd_dev, 194, 1, 161);
-		break;
-	default:
-		return -ENODEV;
-	}
-	current_intensity = intensity;
-	return 0;
-}
-
-static int locomolcd_get_intensity(struct backlight_device *bd)
-{
-	return current_intensity;
-}
-
-static const struct backlight_ops locomobl_data = {
-	.get_brightness = locomolcd_get_intensity,
-	.update_status  = locomolcd_set_intensity,
-};
-
-#ifdef CONFIG_PM_SLEEP
-static int locomolcd_suspend(struct device *dev)
-{
-	locomolcd_flags |= LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-
-static int locomolcd_resume(struct device *dev)
-{
-	locomolcd_flags &= ~LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume);
-
-static int locomolcd_probe(struct locomo_dev *ldev)
-{
-	struct backlight_properties props;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	locomolcd_dev = ldev;
-
-	locomo_gpio_set_dir(ldev->dev.parent, LOCOMO_GPIO_FL_VR, 0);
-
-	/*
-	 * the poodle_lcd_power function is called for the first time
-	 * from fs_initcall, which is before locomo is activated.
-	 * We need to recall poodle_lcd_power here
-	 */
-	if (machine_is_poodle())
-		locomolcd_power(1);
-
-	local_irq_restore(flags);
-
-	memset(&props, 0, sizeof(struct backlight_properties));
-	props.type = BACKLIGHT_RAW;
-	props.max_brightness = 4;
-	locomolcd_bl_device = backlight_device_register("locomo-bl",
-							&ldev->dev, NULL,
-							&locomobl_data, &props);
-
-	if (IS_ERR(locomolcd_bl_device))
-		return PTR_ERR(locomolcd_bl_device);
-
-	/* Set up frontlight so that screen is readable */
-	locomolcd_bl_device->props.brightness = 2;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	return 0;
-}
-
-static int locomolcd_remove(struct locomo_dev *dev)
-{
-	unsigned long flags;
-
-	locomolcd_bl_device->props.brightness = 0;
-	locomolcd_bl_device->props.power = 0;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	backlight_device_unregister(locomolcd_bl_device);
-	local_irq_save(flags);
-	locomolcd_dev = NULL;
-	local_irq_restore(flags);
-	return 0;
-}
-
-static struct locomo_driver poodle_lcd_driver = {
-	.drv = {
-		.name	= "locomo-backlight",
-		.pm	= &locomolcd_pm_ops,
-	},
-	.devid	= LOCOMO_DEVID_BACKLIGHT,
-	.probe	= locomolcd_probe,
-	.remove	= locomolcd_remove,
-};
-
-static int __init locomolcd_init(void)
-{
-	return locomo_driver_register(&poodle_lcd_driver);
-}
-
-static void __exit locomolcd_exit(void)
-{
-	locomo_driver_unregister(&poodle_lcd_driver);
-}
-
-module_init(locomolcd_init);
-module_exit(locomolcd_exit);
-
-MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>, Pavel Machek <pavel@ucw.cz>");
-MODULE_DESCRIPTION("Collie LCD driver");
-MODULE_LICENSE("GPL");
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
From: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org,
	linux-input@vger.kernel.org, linux-leds@vger.kernel.org,
	linux-spi@vger.kernel.org, linux-fbdev@vger.kernel.org,
	alsa-devel@alsa-project.org
Cc: Andrea Adami <andrea.adami@gmail.com>,
	Russell King <linux@arm.linux.org.uk>,
	Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Linus Walleij <linus.walleij@linaro.org>,
	Alexandre Courbot <gnurou@gmail.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Bryan Wu <cooloney@gmail.com>, Richard Purdie <rpurdie@rpsys.net>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>, Mark Brown <broonie@kernel.org>,
	Jingoo Han <jg1.han@samsung.com>,
	Liam Girdwood <lgirdwood@gmail.com>
Subject: [PATCH 07/15] video: backlight: drop old locomo bl/lcd driver
Date: Tue, 28 Oct 2014 00:02:00 +0000	[thread overview]
Message-ID: <1414454528-24240-8-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1414454528-24240-1-git-send-email-dbaryshkov@gmail.com>

Old locomolcd driver is now completely obsolete by new locomo_bl and
locomo_lcd drivers, so let's drop it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/video/backlight/locomolcd.c | 255 ------------------------------------
 1 file changed, 255 deletions(-)
 delete mode 100644 drivers/video/backlight/locomolcd.c

diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
deleted file mode 100644
index 6c3ec42..0000000
--- a/drivers/video/backlight/locomolcd.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Backlight control code for Sharp Zaurus SL-5500
- *
- * Copyright 2005 John Lenz <lenz@cs.wisc.edu>
- * Maintainer: Pavel Machek <pavel@ucw.cz> (unless John wants to :-)
- * GPL v2
- *
- * This driver assumes single CPU. That's okay, because collie is
- * slightly old hardware, and no one is going to retrofit second CPU to
- * old PDA.
- */
-
-/* LCD power functions */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/fb.h>
-#include <linux/backlight.h>
-
-#include <asm/hardware/locomo.h>
-#include <asm/irq.h>
-#include <asm/mach/sharpsl_param.h>
-#include <asm/mach-types.h>
-
-#include "../../../arch/arm/mach-sa1100/generic.h"
-
-static struct backlight_device *locomolcd_bl_device;
-static struct locomo_dev *locomolcd_dev;
-static unsigned long locomolcd_flags;
-#define LOCOMOLCD_SUSPENDED     0x01
-
-static void locomolcd_on(int comadj)
-{
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 1);
-	mdelay(2);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 1);
-	mdelay(2);
-
-	locomo_m62332_senddata(locomolcd_dev, comadj, 0);
-	mdelay(5);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 1);
-	mdelay(10);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel(0x01, locomolcd_dev->mapbase + LOCOMO_TC);
-
-	/* Set CPSD */
-	locomo_writel(6, locomolcd_dev->mapbase + LOCOMO_CPSD);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel((0x04 | 0x01), locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(10);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 1);
-}
-
-static void locomolcd_off(int comadj)
-{
-	/* TFTCRST=1 | CPSOUT=1 | CPSEN = 0 */
-	locomo_writel(0x06, locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(1);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	mdelay(110);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	mdelay(700);
-
-	/* TFTCRST=0 | CPSOUT=0 | CPSEN = 0 */
-	locomo_writel(0, locomolcd_dev->mapbase + LOCOMO_TC);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-}
-
-void locomolcd_power(int on)
-{
-	int comadj = sharpsl_param.comadj;
-	unsigned long flags;
-
-	local_irq_save(flags);
-
-	if (!locomolcd_dev) {
-		local_irq_restore(flags);
-		return;
-	}
-
-	/* read comadj */
-	if (comadj = -1 && machine_is_collie())
-		comadj = 128;
-	if (comadj = -1 && machine_is_poodle())
-		comadj = 118;
-
-	if (on)
-		locomolcd_on(comadj);
-	else
-		locomolcd_off(comadj);
-
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(locomolcd_power);
-
-static int current_intensity;
-
-static int locomolcd_set_intensity(struct backlight_device *bd)
-{
-	int intensity = bd->props.brightness;
-
-	if (bd->props.power != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (locomolcd_flags & LOCOMOLCD_SUSPENDED)
-		intensity = 0;
-
-	switch (intensity) {
-	/*
-	 * AC and non-AC are handled differently,
-	 * but produce same results in sharp code?
-	 */
-	case 0:
-		locomo_frontlight_set(locomolcd_dev, 0, 0, 161);
-		break;
-	case 1:
-		locomo_frontlight_set(locomolcd_dev, 117, 0, 161);
-		break;
-	case 2:
-		locomo_frontlight_set(locomolcd_dev, 163, 0, 148);
-		break;
-	case 3:
-		locomo_frontlight_set(locomolcd_dev, 194, 0, 161);
-		break;
-	case 4:
-		locomo_frontlight_set(locomolcd_dev, 194, 1, 161);
-		break;
-	default:
-		return -ENODEV;
-	}
-	current_intensity = intensity;
-	return 0;
-}
-
-static int locomolcd_get_intensity(struct backlight_device *bd)
-{
-	return current_intensity;
-}
-
-static const struct backlight_ops locomobl_data = {
-	.get_brightness = locomolcd_get_intensity,
-	.update_status  = locomolcd_set_intensity,
-};
-
-#ifdef CONFIG_PM_SLEEP
-static int locomolcd_suspend(struct device *dev)
-{
-	locomolcd_flags |= LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-
-static int locomolcd_resume(struct device *dev)
-{
-	locomolcd_flags &= ~LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume);
-
-static int locomolcd_probe(struct locomo_dev *ldev)
-{
-	struct backlight_properties props;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	locomolcd_dev = ldev;
-
-	locomo_gpio_set_dir(ldev->dev.parent, LOCOMO_GPIO_FL_VR, 0);
-
-	/*
-	 * the poodle_lcd_power function is called for the first time
-	 * from fs_initcall, which is before locomo is activated.
-	 * We need to recall poodle_lcd_power here
-	 */
-	if (machine_is_poodle())
-		locomolcd_power(1);
-
-	local_irq_restore(flags);
-
-	memset(&props, 0, sizeof(struct backlight_properties));
-	props.type = BACKLIGHT_RAW;
-	props.max_brightness = 4;
-	locomolcd_bl_device = backlight_device_register("locomo-bl",
-							&ldev->dev, NULL,
-							&locomobl_data, &props);
-
-	if (IS_ERR(locomolcd_bl_device))
-		return PTR_ERR(locomolcd_bl_device);
-
-	/* Set up frontlight so that screen is readable */
-	locomolcd_bl_device->props.brightness = 2;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	return 0;
-}
-
-static int locomolcd_remove(struct locomo_dev *dev)
-{
-	unsigned long flags;
-
-	locomolcd_bl_device->props.brightness = 0;
-	locomolcd_bl_device->props.power = 0;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	backlight_device_unregister(locomolcd_bl_device);
-	local_irq_save(flags);
-	locomolcd_dev = NULL;
-	local_irq_restore(flags);
-	return 0;
-}
-
-static struct locomo_driver poodle_lcd_driver = {
-	.drv = {
-		.name	= "locomo-backlight",
-		.pm	= &locomolcd_pm_ops,
-	},
-	.devid	= LOCOMO_DEVID_BACKLIGHT,
-	.probe	= locomolcd_probe,
-	.remove	= locomolcd_remove,
-};
-
-static int __init locomolcd_init(void)
-{
-	return locomo_driver_register(&poodle_lcd_driver);
-}
-
-static void __exit locomolcd_exit(void)
-{
-	locomo_driver_unregister(&poodle_lcd_driver);
-}
-
-module_init(locomolcd_init);
-module_exit(locomolcd_exit);
-
-MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>, Pavel Machek <pavel@ucw.cz>");
-MODULE_DESCRIPTION("Collie LCD driver");
-MODULE_LICENSE("GPL");
-- 
2.1.1


WARNING: multiple messages have this Message-ID (diff)
From: dbaryshkov@gmail.com (Dmitry Eremin-Solenikov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 07/15] video: backlight: drop old locomo bl/lcd driver
Date: Tue, 28 Oct 2014 03:02:00 +0300	[thread overview]
Message-ID: <1414454528-24240-8-git-send-email-dbaryshkov@gmail.com> (raw)
In-Reply-To: <1414454528-24240-1-git-send-email-dbaryshkov@gmail.com>

Old locomolcd driver is now completely obsolete by new locomo_bl and
locomo_lcd drivers, so let's drop it.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
---
 drivers/video/backlight/locomolcd.c | 255 ------------------------------------
 1 file changed, 255 deletions(-)
 delete mode 100644 drivers/video/backlight/locomolcd.c

diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
deleted file mode 100644
index 6c3ec42..0000000
--- a/drivers/video/backlight/locomolcd.c
+++ /dev/null
@@ -1,255 +0,0 @@
-/*
- * Backlight control code for Sharp Zaurus SL-5500
- *
- * Copyright 2005 John Lenz <lenz@cs.wisc.edu>
- * Maintainer: Pavel Machek <pavel@ucw.cz> (unless John wants to :-)
- * GPL v2
- *
- * This driver assumes single CPU. That's okay, because collie is
- * slightly old hardware, and no one is going to retrofit second CPU to
- * old PDA.
- */
-
-/* LCD power functions */
-#include <linux/module.h>
-#include <linux/init.h>
-#include <linux/delay.h>
-#include <linux/device.h>
-#include <linux/interrupt.h>
-#include <linux/fb.h>
-#include <linux/backlight.h>
-
-#include <asm/hardware/locomo.h>
-#include <asm/irq.h>
-#include <asm/mach/sharpsl_param.h>
-#include <asm/mach-types.h>
-
-#include "../../../arch/arm/mach-sa1100/generic.h"
-
-static struct backlight_device *locomolcd_bl_device;
-static struct locomo_dev *locomolcd_dev;
-static unsigned long locomolcd_flags;
-#define LOCOMOLCD_SUSPENDED     0x01
-
-static void locomolcd_on(int comadj)
-{
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 1);
-	mdelay(2);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 1);
-	mdelay(2);
-
-	locomo_m62332_senddata(locomolcd_dev, comadj, 0);
-	mdelay(5);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 1);
-	mdelay(10);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel(0x01, locomolcd_dev->mapbase + LOCOMO_TC);
-
-	/* Set CPSD */
-	locomo_writel(6, locomolcd_dev->mapbase + LOCOMO_CPSD);
-
-	/* TFTCRST | CPSOUT=0 | CPSEN */
-	locomo_writel((0x04 | 0x01), locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(10);
-
-	locomo_gpio_set_dir(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 1);
-}
-
-static void locomolcd_off(int comadj)
-{
-	/* TFTCRST=1 | CPSOUT=1 | CPSEN = 0 */
-	locomo_writel(0x06, locomolcd_dev->mapbase + LOCOMO_TC);
-	mdelay(1);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHA_ON, 0);
-	mdelay(110);
-
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VEE_ON, 0);
-	mdelay(700);
-
-	/* TFTCRST=0 | CPSOUT=0 | CPSEN = 0 */
-	locomo_writel(0, locomolcd_dev->mapbase + LOCOMO_TC);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_MOD, 0);
-	locomo_gpio_write(locomolcd_dev->dev.parent, LOCOMO_GPIO_LCD_VSHD_ON, 0);
-}
-
-void locomolcd_power(int on)
-{
-	int comadj = sharpsl_param.comadj;
-	unsigned long flags;
-
-	local_irq_save(flags);
-
-	if (!locomolcd_dev) {
-		local_irq_restore(flags);
-		return;
-	}
-
-	/* read comadj */
-	if (comadj == -1 && machine_is_collie())
-		comadj = 128;
-	if (comadj == -1 && machine_is_poodle())
-		comadj = 118;
-
-	if (on)
-		locomolcd_on(comadj);
-	else
-		locomolcd_off(comadj);
-
-	local_irq_restore(flags);
-}
-EXPORT_SYMBOL(locomolcd_power);
-
-static int current_intensity;
-
-static int locomolcd_set_intensity(struct backlight_device *bd)
-{
-	int intensity = bd->props.brightness;
-
-	if (bd->props.power != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (bd->props.fb_blank != FB_BLANK_UNBLANK)
-		intensity = 0;
-	if (locomolcd_flags & LOCOMOLCD_SUSPENDED)
-		intensity = 0;
-
-	switch (intensity) {
-	/*
-	 * AC and non-AC are handled differently,
-	 * but produce same results in sharp code?
-	 */
-	case 0:
-		locomo_frontlight_set(locomolcd_dev, 0, 0, 161);
-		break;
-	case 1:
-		locomo_frontlight_set(locomolcd_dev, 117, 0, 161);
-		break;
-	case 2:
-		locomo_frontlight_set(locomolcd_dev, 163, 0, 148);
-		break;
-	case 3:
-		locomo_frontlight_set(locomolcd_dev, 194, 0, 161);
-		break;
-	case 4:
-		locomo_frontlight_set(locomolcd_dev, 194, 1, 161);
-		break;
-	default:
-		return -ENODEV;
-	}
-	current_intensity = intensity;
-	return 0;
-}
-
-static int locomolcd_get_intensity(struct backlight_device *bd)
-{
-	return current_intensity;
-}
-
-static const struct backlight_ops locomobl_data = {
-	.get_brightness = locomolcd_get_intensity,
-	.update_status  = locomolcd_set_intensity,
-};
-
-#ifdef CONFIG_PM_SLEEP
-static int locomolcd_suspend(struct device *dev)
-{
-	locomolcd_flags |= LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-
-static int locomolcd_resume(struct device *dev)
-{
-	locomolcd_flags &= ~LOCOMOLCD_SUSPENDED;
-	locomolcd_set_intensity(locomolcd_bl_device);
-	return 0;
-}
-#endif
-
-static SIMPLE_DEV_PM_OPS(locomolcd_pm_ops, locomolcd_suspend, locomolcd_resume);
-
-static int locomolcd_probe(struct locomo_dev *ldev)
-{
-	struct backlight_properties props;
-	unsigned long flags;
-
-	local_irq_save(flags);
-	locomolcd_dev = ldev;
-
-	locomo_gpio_set_dir(ldev->dev.parent, LOCOMO_GPIO_FL_VR, 0);
-
-	/*
-	 * the poodle_lcd_power function is called for the first time
-	 * from fs_initcall, which is before locomo is activated.
-	 * We need to recall poodle_lcd_power here
-	 */
-	if (machine_is_poodle())
-		locomolcd_power(1);
-
-	local_irq_restore(flags);
-
-	memset(&props, 0, sizeof(struct backlight_properties));
-	props.type = BACKLIGHT_RAW;
-	props.max_brightness = 4;
-	locomolcd_bl_device = backlight_device_register("locomo-bl",
-							&ldev->dev, NULL,
-							&locomobl_data, &props);
-
-	if (IS_ERR(locomolcd_bl_device))
-		return PTR_ERR(locomolcd_bl_device);
-
-	/* Set up frontlight so that screen is readable */
-	locomolcd_bl_device->props.brightness = 2;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	return 0;
-}
-
-static int locomolcd_remove(struct locomo_dev *dev)
-{
-	unsigned long flags;
-
-	locomolcd_bl_device->props.brightness = 0;
-	locomolcd_bl_device->props.power = 0;
-	locomolcd_set_intensity(locomolcd_bl_device);
-
-	backlight_device_unregister(locomolcd_bl_device);
-	local_irq_save(flags);
-	locomolcd_dev = NULL;
-	local_irq_restore(flags);
-	return 0;
-}
-
-static struct locomo_driver poodle_lcd_driver = {
-	.drv = {
-		.name	= "locomo-backlight",
-		.pm	= &locomolcd_pm_ops,
-	},
-	.devid	= LOCOMO_DEVID_BACKLIGHT,
-	.probe	= locomolcd_probe,
-	.remove	= locomolcd_remove,
-};
-
-static int __init locomolcd_init(void)
-{
-	return locomo_driver_register(&poodle_lcd_driver);
-}
-
-static void __exit locomolcd_exit(void)
-{
-	locomo_driver_unregister(&poodle_lcd_driver);
-}
-
-module_init(locomolcd_init);
-module_exit(locomolcd_exit);
-
-MODULE_AUTHOR("John Lenz <lenz@cs.wisc.edu>, Pavel Machek <pavel@ucw.cz>");
-MODULE_DESCRIPTION("Collie LCD driver");
-MODULE_LICENSE("GPL");
-- 
2.1.1

  parent reply	other threads:[~2014-10-28  0:02 UTC|newest]

Thread overview: 162+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-28  0:01 [PATCH 00/15] new locomo driver Dmitry Eremin-Solenikov
2014-10-28  0:01 ` Dmitry Eremin-Solenikov
2014-10-28  0:01 ` Dmitry Eremin-Solenikov
2014-10-28  0:01 ` [PATCH 01/15] mfd: add new driver for Sharp LoCoMo Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
     [not found]   ` <1414454528-24240-2-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-31  7:42     ` Linus Walleij
2014-10-31  7:42       ` Linus Walleij
2014-10-31  7:42       ` Linus Walleij
2014-10-31  9:54       ` Dmitry Eremin-Solenikov
2014-10-31  9:54         ` Dmitry Eremin-Solenikov
2014-10-31  9:54         ` Dmitry Eremin-Solenikov
     [not found]         ` <CALT56yNX8v4mZn=o1ZoVLHPmg6wq0dgFNowpqNuFtU=eCc+d8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-03 13:41           ` Linus Walleij
2014-11-03 13:41             ` Linus Walleij
2014-11-03 13:41             ` Linus Walleij
2014-11-05 20:02             ` Dmitry Eremin-Solenikov
2014-11-05 20:02               ` Dmitry Eremin-Solenikov
2014-11-05 20:02               ` Dmitry Eremin-Solenikov
2014-11-05 20:24               ` Mark Brown
2014-11-05 20:24                 ` Mark Brown
2014-11-05 20:24                 ` Mark Brown
2014-11-14 12:47                 ` Dmitry Eremin-Solenikov
2014-11-14 12:47                   ` Dmitry Eremin-Solenikov
2014-11-14 12:47                   ` Dmitry Eremin-Solenikov
2014-11-14 15:10                   ` Mark Brown
2014-11-14 15:10                     ` Mark Brown
2014-11-14 15:30                     ` Dmitry Eremin-Solenikov
2014-11-14 15:30                       ` Dmitry Eremin-Solenikov
2014-11-14 15:30                       ` Dmitry Eremin-Solenikov
2014-11-05 20:32               ` Lars-Peter Clausen
2014-11-05 20:32                 ` Lars-Peter Clausen
2014-11-05 20:32                 ` Lars-Peter Clausen
2014-11-05 20:32                 ` Lars-Peter Clausen
2014-11-05 20:42                 ` Lars-Peter Clausen
2014-11-05 20:42                   ` Lars-Peter Clausen
2014-11-05 20:42                   ` Lars-Peter Clausen
2014-10-28  0:01 ` [PATCH 02/15] GPIO: port LoCoMo gpio support from old driver Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-31  7:48   ` Linus Walleij
2014-10-31  7:48     ` Linus Walleij
2014-10-31  7:48     ` Linus Walleij
     [not found]     ` <CACRpkdY7tRadod2vQfEytmw-ubaMAvr_=XTczD5bUMkqie0xkg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31  9:39       ` Dmitry Eremin-Solenikov
2014-10-31  9:39         ` Dmitry Eremin-Solenikov
2014-10-31  9:39         ` Dmitry Eremin-Solenikov
     [not found]         ` <CALT56yOgMUA7o2dzfHph=S2zkDV4zERzMh4ishpPwpAx7Cqj6Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-03 13:43           ` Linus Walleij
2014-11-03 13:43             ` Linus Walleij
2014-11-03 13:43             ` Linus Walleij
     [not found]             ` <CACRpkdb7v3LmOhbhQ9TPk1_bnLnpwizawW6RQvhQRLSjRewAaQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-05 21:33               ` Dmitry Eremin-Solenikov
2014-11-05 21:33                 ` Dmitry Eremin-Solenikov
2014-11-05 21:33                 ` Dmitry Eremin-Solenikov
2014-11-06  6:03                 ` Mark Brown
2014-11-06  6:03                   ` Mark Brown
2014-11-06  6:03                   ` Mark Brown
2014-11-11 13:16                   ` Dmitry Eremin-Solenikov
2014-11-11 13:16                     ` Dmitry Eremin-Solenikov
2014-11-11 13:16                     ` Dmitry Eremin-Solenikov
     [not found]                     ` <CALT56yPr42FV66USngocw=eWPt81d5R2MJxmzBnv02HOMmXAkA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-11 13:23                       ` Mark Brown
2014-11-11 13:23                         ` Mark Brown
2014-11-11 13:23                         ` Mark Brown
2014-11-14 10:11                       ` Linus Walleij
2014-11-14 10:11                         ` Linus Walleij
2014-11-14 10:11                         ` Linus Walleij
2014-11-14 12:48                         ` Dmitry Eremin-Solenikov
2014-11-14 12:48                           ` Dmitry Eremin-Solenikov
2014-11-14 12:48                           ` Dmitry Eremin-Solenikov
2014-10-28  0:01 ` [PATCH 03/15] leds: port locomo leds driver to new locomo core Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
     [not found] ` <1414454528-24240-1-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-28  0:01   ` [PATCH 04/15] input: convert LoCoMo keyboard driver to use " Dmitry Eremin-Solenikov
2014-10-28  0:01     ` Dmitry Eremin-Solenikov
2014-10-28  0:01     ` Dmitry Eremin-Solenikov
2014-10-28  0:09     ` Dmitry Torokhov
2014-10-28  0:09       ` Dmitry Torokhov
2014-10-28  0:09       ` Dmitry Torokhov
2014-10-28  0:02   ` [PATCH 08/15] ARM: sa1100: make collie use new locomo drivers Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` [PATCH 12/15] ARM: pxa: poodle: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28 19:13     ` Robert Jarzmik
2014-10-28 19:13       ` Robert Jarzmik
2014-10-28 19:13       ` Robert Jarzmik
2014-10-28  0:02   ` [PATCH 13/15] ARM: drop old LoCoMo driver Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` [PATCH 14/15] gpio: locomo: implement per-pin irq handling Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-31  8:00     ` Linus Walleij
2014-10-31  8:00       ` Linus Walleij
2014-10-31  8:00       ` Linus Walleij
2014-10-31  9:35       ` Dmitry Eremin-Solenikov
2014-10-31  9:35         ` Dmitry Eremin-Solenikov
2014-10-31  9:35         ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` [PATCH 15/15] spi: add locomo SPI driver Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
2014-10-28  0:02     ` Dmitry Eremin-Solenikov
     [not found]     ` <1414454528-24240-16-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-28 11:03       ` Mark Brown
2014-10-28 11:03         ` Mark Brown
2014-10-28 11:03         ` Mark Brown
2014-10-28  0:01 ` [PATCH 05/15] video: backlight: add new locomo backlight driver Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:24   ` Jingoo Han
2014-10-28  0:24     ` Jingoo Han
2014-10-28  0:24     ` Jingoo Han
2014-10-28  0:01 ` [PATCH 06/15] video: lcd: add LoCoMo LCD driver Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:01   ` Dmitry Eremin-Solenikov
2014-10-28  0:30   ` Jingoo Han
2014-10-28  0:30     ` Jingoo Han
2014-10-28  0:30     ` Jingoo Han
2014-10-28 16:47     ` Dmitry Eremin-Solenikov
2014-10-28 16:47       ` Dmitry Eremin-Solenikov
2014-10-28 16:47       ` Dmitry Eremin-Solenikov
2014-10-28  0:02 ` Dmitry Eremin-Solenikov [this message]
2014-10-28  0:02   ` [PATCH 07/15] video: backlight: drop old locomo bl/lcd driver Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-28  0:02 ` [PATCH 09/15] ARM: sa1100: don't preallocate IRQ space for locomo Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-31  7:50   ` Linus Walleij
2014-10-31  7:50     ` Linus Walleij
2014-10-31  7:50     ` Linus Walleij
2014-10-31  9:33     ` Dmitry Eremin-Solenikov
2014-10-31  9:33       ` Dmitry Eremin-Solenikov
2014-10-31  9:33       ` Dmitry Eremin-Solenikov
2014-10-28  0:02 ` [PATCH 10/15] ARM: pxa: poodle: use new LoCoMo driver Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-28  0:02 ` [PATCH 11/15] sound: soc: poodle: make use of new locomo GPIO interface Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
2014-10-28  0:02   ` Dmitry Eremin-Solenikov
     [not found]   ` <1414454528-24240-12-git-send-email-dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2014-10-28 14:58     ` Mark Brown
2014-10-28 14:58       ` Mark Brown
2014-10-28 14:58       ` Mark Brown
     [not found]       ` <20141028145850.GU18557-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-10-28 16:45         ` Dmitry Eremin-Solenikov
2014-10-28 16:45           ` Dmitry Eremin-Solenikov
2014-10-28 16:45           ` Dmitry Eremin-Solenikov
2014-10-29  3:03       ` Alexandre Courbot
2014-10-29  3:03         ` Alexandre Courbot
2014-10-29  3:03         ` Alexandre Courbot
2014-10-29  3:03         ` Alexandre Courbot
     [not found]         ` <CAAVeFuKgARoMFzf+663iP6cULs93d4WSQS8ESjUb9VcxguWurA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-10-31  9:52           ` Linus Walleij
2014-10-31  9:52             ` Linus Walleij
2014-10-31  9:52             ` Linus Walleij
2014-10-31  9:52             ` Linus Walleij
2014-10-31  9:58             ` Dmitry Eremin-Solenikov
2014-10-31  9:58               ` Dmitry Eremin-Solenikov
2014-10-31  9:58               ` Dmitry Eremin-Solenikov
2014-11-01  5:42               ` Alexandre Courbot
2014-11-01  5:42                 ` Alexandre Courbot
2014-11-01  5:42                 ` Alexandre Courbot
2014-10-28  0:13 ` [PATCH 00/15] new locomo driver Russell King - ARM Linux
2014-10-28  0:13   ` Russell King - ARM Linux
     [not found]   ` <20141028001338.GZ27405-l+eeeJia6m9vn6HldHNs0ANdhmdF6hFW@public.gmane.org>
2014-10-28  0:28     ` Dmitry Eremin-Solenikov
2014-10-28  0:28       ` Dmitry Eremin-Solenikov
2014-10-28  0:28       ` Dmitry Eremin-Solenikov
2014-10-28  0:29   ` Mark Brown
2014-10-28  0:29     ` Mark Brown
2014-10-29 18:56   ` Dmitry Eremin-Solenikov
2014-10-29 22:32     ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1414454528-24240-8-git-send-email-dbaryshkov@gmail.com \
    --to=dbaryshkov@gmail.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=andrea.adami@gmail.com \
    --cc=broonie@kernel.org \
    --cc=cooloney@gmail.com \
    --cc=daniel@zonque.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gnurou@gmail.com \
    --cc=haojian.zhuang@gmail.com \
    --cc=jg1.han@samsung.com \
    --cc=lee.jones@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=robert.jarzmik@free.fr \
    --cc=rpurdie@rpsys.net \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.