From patchwork Thu Sep 8 15:22:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tero Kristo X-Patchwork-Id: 1130022 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p88FMb38002601 for ; Thu, 8 Sep 2011 15:22:40 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753601Ab1IHPWh (ORCPT ); Thu, 8 Sep 2011 11:22:37 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:47217 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753457Ab1IHPWf convert rfc822-to-8bit (ORCPT ); Thu, 8 Sep 2011 11:22:35 -0400 Received: from dlep34.itg.ti.com ([157.170.170.115]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p88FMWjT032114 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Sep 2011 10:22:32 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep34.itg.ti.com (8.13.7/8.13.8) with ESMTP id p88FMWZ2009716; Thu, 8 Sep 2011 10:22:32 -0500 (CDT) Received: from dnce72.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p88FMVOr022490; Thu, 8 Sep 2011 10:22:31 -0500 (CDT) thread-index: AcxuOyCxrX91MYdfQg291bzKLAtzmw== Content-Class: urn:content-classes:message Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4657 Received: from localhost.localdomain (172.24.88.2) by dnce72.ent.ti.com (137.167.131.87) with Microsoft SMTP Server (TLS) id 8.3.106.1; Thu, 8 Sep 2011 17:22:31 +0200 From: Tero Kristo To: CC: , , Subject: [PATCHv7 1/9] power: add omap prm driver skeleton Date: Thu, 8 Sep 2011 18:22:16 +0300 Message-ID: <1315495344-23133-2-git-send-email-t-kristo@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315495344-23133-1-git-send-email-t-kristo@ti.com> References: <1315495344-23133-1-git-send-email-t-kristo@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 08 Sep 2011 15:22:40 +0000 (UTC) This driver will eventually support OMAP soc PRM module features, e.g. PRCM chain interrupts. Signed-off-by: Tero Kristo --- drivers/power/Kconfig | 7 ++++ drivers/power/Makefile | 1 + drivers/power/omap_prm.c | 83 ++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 0 deletions(-) create mode 100644 drivers/power/omap_prm.c diff --git a/drivers/power/Kconfig b/drivers/power/Kconfig index 57de051..e735a95 100644 --- a/drivers/power/Kconfig +++ b/drivers/power/Kconfig @@ -249,4 +249,11 @@ config CHARGER_MAX8998 Say Y to enable support for the battery charger control sysfs and platform data of MAX8998/LP3974 PMICs. +config OMAP_PRM + bool "OMAP Power and Reset Management driver" + depends on (ARCH_OMAP) && PM + help + Say Y to enable support for the OMAP Power and Reset Management + driver. + endif # POWER_SUPPLY diff --git a/drivers/power/Makefile b/drivers/power/Makefile index b4af13d..8df93c2 100644 --- a/drivers/power/Makefile +++ b/drivers/power/Makefile @@ -13,6 +13,7 @@ obj-$(CONFIG_WM831X_BACKUP) += wm831x_backup.o obj-$(CONFIG_WM831X_POWER) += wm831x_power.o obj-$(CONFIG_WM8350_POWER) += wm8350_power.o obj-$(CONFIG_TEST_POWER) += test_power.o +obj-$(CONFIG_OMAP_PRM) += omap_prm.o obj-$(CONFIG_BATTERY_DS2760) += ds2760_battery.o obj-$(CONFIG_BATTERY_DS2780) += ds2780_battery.o diff --git a/drivers/power/omap_prm.c b/drivers/power/omap_prm.c new file mode 100644 index 0000000..dfc0920 --- /dev/null +++ b/drivers/power/omap_prm.c @@ -0,0 +1,83 @@ +/* + * OMAP Power and Reset Management (PRM) driver + * + * Copyright (C) 2011 Texas Instruments, Inc. + * + * Author: Tero Kristo + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define DRIVER_NAME "omap-prm" + +struct omap_prm_device { + struct platform_device pdev; +}; + +static struct omap_prm_device prm_dev = { + .pdev = { + .name = DRIVER_NAME, + .id = -1, + }, +}; + +static int __init omap_prm_probe(struct platform_device *pdev) +{ + return 0; +} + +static int __devexit omap_prm_remove(struct platform_device *pdev) +{ + return 0; +} + +static struct platform_driver prm_driver = { + .remove = __exit_p(omap_prm_remove), + .driver = { + .name = DRIVER_NAME, + }, +}; + +static int __init omap_prm_init(void) +{ + int ret; + + ret = platform_device_register(&prm_dev.pdev); + + if (ret) { + printk(KERN_ERR "Unable to register PRM device: %d\n", ret); + return ret; + } + + ret = platform_driver_probe(&prm_driver, omap_prm_probe); + + if (ret) + printk(KERN_ERR "PRM driver probe failed: %d\n", ret); + + return ret; +} +subsys_initcall(omap_prm_init); + +static void __exit omap_prm_exit(void) +{ + platform_device_unregister(&prm_dev.pdev); + platform_driver_unregister(&prm_driver); +} +module_exit(omap_prm_exit); + +MODULE_ALIAS("platform:"DRIVER_NAME); +MODULE_AUTHOR("Tero Kristo "); +MODULE_DESCRIPTION("OMAP PRM driver"); +MODULE_LICENSE("GPL");