staging: nvec: rename led driver to board specific paz00 driver
authorMarc Dietrich <marvin24@gmx.de>
Sun, 24 Jun 2012 21:25:20 +0000 (23:25 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jun 2012 17:55:38 +0000 (10:55 -0700)
The led driver used OEM commands which are not part of the nvec protocol
definition. Therefore it is renamed to nvec_paz00 to reflect that it only
applies to PAZ00 board based devices.

Signed-off-by: Marc Dietrich <marvin24@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/nvec/Kconfig
drivers/staging/nvec/Makefile
drivers/staging/nvec/nvec.c
drivers/staging/nvec/nvec_leds.c [deleted file]
drivers/staging/nvec/nvec_paz00.c [new file with mode: 0644]

index 731301f524a6cd5c749e518dd1aedcf20e7c2e3c..43048e9ba0d414fcc9a2e76a6c8cf67a236b9689 100644 (file)
@@ -26,8 +26,9 @@ config NVEC_POWER
          Say Y to enable support for battery and charger interface for
          nVidia compliant embedded controllers.
 
-config NVEC_LEDS
-       bool "NVEC leds"
-       depends on MFD_NVEC && LEDS_CLASS
+config NVEC_PAZ00
+       bool "Support for OEM specific functions on Compal PAZ00 based devices"
+       depends on MFD_NVEC && LEDS_CLASS && MACH_PAZ00
        help
-         Say Y to enable yellow side leds on AC100 or other nVidia tegra nvec leds
+         Say Y to enable control of the yellow side leds on Compal PAZ00 based
+         devices, e.g. Toshbia AC100 and Dynabooks AZ netbooks.
index b844d604e3acad21da871584ec93b002ee6cbb17..0db0e1f43337c62bd017133dc02050f500acb217 100644 (file)
@@ -2,4 +2,4 @@ obj-$(CONFIG_SERIO_NVEC_PS2)    += nvec_ps2.o
 obj-$(CONFIG_MFD_NVEC)         += nvec.o
 obj-$(CONFIG_NVEC_POWER)       += nvec_power.o
 obj-$(CONFIG_KEYBOARD_NVEC)    += nvec_kbd.o
-obj-$(CONFIG_NVEC_LEDS)        += nvec_leds.o
+obj-$(CONFIG_NVEC_PAZ00)       += nvec_paz00.o
index 221bc055ef98aff9ff964ae09f8c4aefee69adfa..0f2b541add186f42003dcdee345789ec4db071c7 100644 (file)
@@ -97,7 +97,7 @@ static struct mfd_cell nvec_devices[] = {
                .id = 2,
        },
        {
-               .name = "nvec-leds",
+               .name = "nvec-paz00",
                .id = 1,
        },
 };
diff --git a/drivers/staging/nvec/nvec_leds.c b/drivers/staging/nvec/nvec_leds.c
deleted file mode 100644 (file)
index 53cb571..0000000
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * nvec_leds: LED driver for a NVIDIA compliant embedded controller
- *
- * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.launchpad.net>
- *
- * Authors:  Ilya Petrov <ilya.muromec@gmail.com>
- *
- * This file is subject to the terms and conditions of the GNU General Public
- * License.  See the file "COPYING" in the main directory of this archive
- * for more details.
- *
- */
-
-#include <linux/module.h>
-#include <linux/err.h>
-#include <linux/slab.h>
-#include <linux/leds.h>
-#include <linux/platform_device.h>
-#include "nvec.h"
-
-#define to_nvec_led(led_cdev) \
-       container_of(led_cdev, struct nvec_led, cdev)
-
-#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
-
-#define NVEC_LED_MAX 8
-
-struct nvec_led {
-       struct led_classdev cdev;
-       struct nvec_chip *nvec;
-};
-
-static void nvec_led_brightness_set(struct led_classdev *led_cdev,
-                                   enum led_brightness value)
-{
-       struct nvec_led *led = to_nvec_led(led_cdev);
-       unsigned char buf[] = NVEC_LED_REQ;
-       buf[4] = value;
-
-       nvec_write_async(led->nvec, buf, sizeof(buf));
-
-       led->cdev.brightness = value;
-
-}
-
-static int __devinit nvec_led_probe(struct platform_device *pdev)
-{
-       struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
-       struct nvec_led *led;
-       int ret = 0;
-
-       led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
-       if (led == NULL)
-               return -ENOMEM;
-
-       led->cdev.max_brightness = NVEC_LED_MAX;
-
-       led->cdev.brightness_set = nvec_led_brightness_set;
-       led->cdev.name = "nvec-led";
-       led->cdev.flags |= LED_CORE_SUSPENDRESUME;
-       led->nvec = nvec;
-
-       platform_set_drvdata(pdev, led);
-
-       ret = led_classdev_register(&pdev->dev, &led->cdev);
-       if (ret < 0)
-               return ret;
-
-       /* to expose the default value to userspace */
-       led->cdev.brightness = 0;
-
-       return 0;
-}
-
-static int __devexit nvec_led_remove(struct platform_device *pdev)
-{
-       struct nvec_led *led = platform_get_drvdata(pdev);
-
-       led_classdev_unregister(&led->cdev);
-
-       return 0;
-}
-
-static struct platform_driver nvec_led_driver = {
-       .probe  = nvec_led_probe,
-       .remove = __devexit_p(nvec_led_remove),
-       .driver = {
-                  .name  = "nvec-leds",
-                  .owner = THIS_MODULE,
-       },
-};
-
-module_platform_driver(nvec_led_driver);
-
-MODULE_AUTHOR("Ilya Petrov <ilya.muromec@gmail.com>");
-MODULE_DESCRIPTION("Tegra NVEC LED driver");
-MODULE_LICENSE("GPL");
-MODULE_ALIAS("platform:nvec-leds");
diff --git a/drivers/staging/nvec/nvec_paz00.c b/drivers/staging/nvec/nvec_paz00.c
new file mode 100644 (file)
index 0000000..b747e39
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * nvec_paz00: OEM specific driver for Compal PAZ00 based devices
+ *
+ * Copyright (C) 2011 The AC100 Kernel Team <ac100@lists.launchpad.net>
+ *
+ * Authors:  Ilya Petrov <ilya.muromec@gmail.com>
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License.  See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/err.h>
+#include <linux/slab.h>
+#include <linux/leds.h>
+#include <linux/platform_device.h>
+#include "nvec.h"
+
+#define to_nvec_led(led_cdev) \
+       container_of(led_cdev, struct nvec_led, cdev)
+
+#define NVEC_LED_REQ {'\x0d', '\x10', '\x45', '\x10', '\x00'}
+
+#define NVEC_LED_MAX 8
+
+struct nvec_led {
+       struct led_classdev cdev;
+       struct nvec_chip *nvec;
+};
+
+static void nvec_led_brightness_set(struct led_classdev *led_cdev,
+                                   enum led_brightness value)
+{
+       struct nvec_led *led = to_nvec_led(led_cdev);
+       unsigned char buf[] = NVEC_LED_REQ;
+       buf[4] = value;
+
+       nvec_write_async(led->nvec, buf, sizeof(buf));
+
+       led->cdev.brightness = value;
+
+}
+
+static int __devinit nvec_paz00_probe(struct platform_device *pdev)
+{
+       struct nvec_chip *nvec = dev_get_drvdata(pdev->dev.parent);
+       struct nvec_led *led;
+       int ret = 0;
+
+       led = devm_kzalloc(&pdev->dev, sizeof(*led), GFP_KERNEL);
+       if (led == NULL)
+               return -ENOMEM;
+
+       led->cdev.max_brightness = NVEC_LED_MAX;
+
+       led->cdev.brightness_set = nvec_led_brightness_set;
+       led->cdev.name = "paz00-led";
+       led->cdev.flags |= LED_CORE_SUSPENDRESUME;
+       led->nvec = nvec;
+
+       platform_set_drvdata(pdev, led);
+
+       ret = led_classdev_register(&pdev->dev, &led->cdev);
+       if (ret < 0)
+               return ret;
+
+       /* to expose the default value to userspace */
+       led->cdev.brightness = 0;
+
+       return 0;
+}
+
+static int __devexit nvec_paz00_remove(struct platform_device *pdev)
+{
+       struct nvec_led *led = platform_get_drvdata(pdev);
+
+       led_classdev_unregister(&led->cdev);
+
+       return 0;
+}
+
+static struct platform_driver nvec_paz00_driver = {
+       .probe  = nvec_paz00_probe,
+       .remove = __devexit_p(nvec_paz00_remove),
+       .driver = {
+               .name  = "nvec-paz00",
+               .owner = THIS_MODULE,
+       },
+};
+
+module_platform_driver(nvec_paz00_driver);
+
+MODULE_AUTHOR("Ilya Petrov <ilya.muromec@gmail.com>");
+MODULE_DESCRIPTION("Tegra NVEC PAZ00 driver");
+MODULE_LICENSE("GPL");
+MODULE_ALIAS("platform:nvec-paz00");