From patchwork Sun May 17 16:27:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 6425151 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 249A9C0432 for ; Sun, 17 May 2015 16:40:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0A5B4205FF for ; Sun, 17 May 2015 16:40:40 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DCB66205D4 for ; Sun, 17 May 2015 16:40:38 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yu1ZB-0004XV-J3; Sun, 17 May 2015 16:37:29 +0000 Received: from mail-pd0-x234.google.com ([2607:f8b0:400e:c02::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Yu1SH-00050f-Ph for linux-arm-kernel@lists.infradead.org; Sun, 17 May 2015 16:30:24 +0000 Received: by pdbnk13 with SMTP id nk13so16121141pdb.1 for ; Sun, 17 May 2015 09:30:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=XnQoYf4l3aSXwr08kmliEpWp/JUAwfW2oXclQL3E8Sw=; b=zSlQ45NcUSS4llox1QunOErSuZ1YJJp6PeWNKEwNTtc87gTNlGZ0nb74iCDU/mbdwG 8Cws4xFqENf5K7q/Z9s2cTvGFPrTzNFhc+4P0paOXX0WxS0um6d2irmeFJZGwOdZXhjo Rnv3KGNysnu7W2zluQUEEXJjo0sVduUCntNKCcMqkzz27f2Xi3eLa52Pqpa+jlt+J7VL Kh9Qh2Pl/FESNpNBbG1itzaxYkQtJNB1EGHFGa33on7xni7UhpQ73HmrAjtdLoF1TB+E EhP4uGxx7h7JPPbI9U47M9W9DzvZPhweNP9kLnqpTDwa3j+Bz/tPh+d23uR5ASKujlpx 6Akw== X-Received: by 10.70.136.67 with SMTP id py3mr36973835pdb.112.1431880200814; Sun, 17 May 2015 09:30:00 -0700 (PDT) Received: from fangorn.rup.mentorg.com (nat-min.mentorg.com. [139.181.32.34]) by mx.google.com with ESMTPSA id pw9sm7574264pac.27.2015.05.17.09.29.54 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 17 May 2015 09:30:00 -0700 (PDT) From: Dmitry Eremin-Solenikov To: Russell King , Daniel Mack , Robert Jarzmik , Linus Walleij , Alexandre Courbot , Wolfram Sang , Dmitry Torokhov , Bryan Wu , Richard Purdie , Samuel Ortiz , Lee Jones , Mark Brown , Jingoo Han , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , Liam Girdwood , Andrea Adami Subject: [PATCH v3 16/17] video: backlight: drop old locomo bl/lcd driver Date: Sun, 17 May 2015 19:27:56 +0300 Message-Id: <1431880077-26321-17-git-send-email-dbaryshkov@gmail.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com> References: <1431880077-26321-1-git-send-email-dbaryshkov@gmail.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150517_093022_021043_04C00C37 X-CRM114-Status: GOOD ( 14.77 ) X-Spam-Score: -0.8 (/) Cc: linux-fbdev@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, linux-gpio@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-input@vger.kernel.org, linux-leds@vger.kernel.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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 - * Maintainer: Pavel Machek (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 -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include - -#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 , Pavel Machek "); -MODULE_DESCRIPTION("Collie LCD driver"); -MODULE_LICENSE("GPL");