aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorDurgadoss R <durgadoss.r@intel.com>2010-12-09 10:37:40 +0000
committerAlan Cox <alan@linux.intel.com>2010-12-09 10:37:40 +0000
commit44c2514121c88ea77f8a754531b38fe4c3393598 (patch)
tree3822f26643e3b809a952ed03ba5cd35e098a3a60 /arch
parent7b58005274b195331dd4d57c069347fbc7e06d6c (diff)
downloadmrst-s0i3-test-44c2514121c88ea77f8a754531b38fe4c3393598.tar.gz
mrst-s0i3-test-44c2514121c88ea77f8a754531b38fe4c3393598.tar.xz
mrst-s0i3-test-44c2514121c88ea77f8a754531b38fe4c3393598.zip
Medfield_Current_Monitoring_Driver
This is the Intel Medfield Current Monitoring Driver patch. The platform specific data required by the driver are provided by adding necessary code in arch/x86/platform/mrst/mrst.c This driver monitors the platform current usage and handles interrupts when the configured current thresholds are crossed. A detailed documentation for this, has been added in Documentation/hwmon/current_monitor. Signed-off-by: Durgadoss R <durgadoss.r@intel.com> Signed-off-by: Alan Cox <alan@linux.intel.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/platform/mrst/mrst.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/arch/x86/platform/mrst/mrst.c b/arch/x86/platform/mrst/mrst.c
index 7ece498180f..6c62b6a2218 100644
--- a/arch/x86/platform/mrst/mrst.c
+++ b/arch/x86/platform/mrst/mrst.c
@@ -389,6 +389,18 @@ struct devs_id {
void *(*get_platform_data)(void *info);
};
+static void __init install_irq_resource(struct platform_device *pdev,
+ char *name, int irq)
+{
+ /* Single threaded */
+ static struct resource __initdata res = {
+ .flags = IORESOURCE_IRQ,
+ };
+ res.name = name;
+ res.start = irq;
+ platform_device_add_resources(pdev, &res, 1);
+}
+
/* the offset for the mapping of global gpio pin to irq */
#define MRST_IRQ_OFFSET 0x100
@@ -478,6 +490,20 @@ static void __init *emc1403_platform_data(void *info)
return &intr2nd_pdata;
}
+static void __init *msic_ocd_platform_data(void *info)
+{
+ /* Platform Specific data for Current Monitoring Driver */
+ int gpio_base;
+ struct platform_device *pdev = (struct platform_device *)info;
+
+ gpio_base = get_gpio_by_name("msic_ocd");
+ if (gpio_base == -1)
+ return NULL;
+
+ install_irq_resource(pdev, "msic_ocd", gpio_base + MRST_IRQ_OFFSET);
+ return NULL;
+}
+
static void __init *lis331dl_platform_data(void *info)
{
static short intr2nd_pdata;
@@ -496,6 +522,7 @@ static void __init *lis331dl_platform_data(void *info)
static const struct devs_id __initconst device_ids[] = {
{"pmic_gpio", SFI_DEV_TYPE_SPI, 1, &pmic_gpio_platform_data},
+ {"msic_ocd", SFI_DEV_TYPE_IPC, 1, &msic_ocd_platform_data},
{"spi_max3111", SFI_DEV_TYPE_SPI, 0, &max3111_platform_data},
{"i2c_max7315", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
{"i2c_max7315_2", SFI_DEV_TYPE_I2C, 1, &max7315_platform_data},
@@ -604,16 +631,6 @@ void intel_scu_devices_destroy(void)
}
EXPORT_SYMBOL_GPL(intel_scu_devices_destroy);
-static void __init install_irq_resource(struct platform_device *pdev, int irq)
-{
- /* Single threaded */
- static struct resource __initdata res = {
- .name = "IRQ",
- .flags = IORESOURCE_IRQ,
- };
- res.start = irq;
- platform_device_add_resources(pdev, &res, 1);
-}
static void __init sfi_handle_ipc_dev(struct platform_device *pdev)
{
@@ -711,7 +728,7 @@ static int __init sfi_parse_devs(struct sfi_table_header *table)
pentry->name);
continue;
}
- install_irq_resource(pdev, pentry->irq);
+ install_irq_resource(pdev, "IRQ", pentry->irq);
pr_debug("info[%2d]: IPC bus, name = %16.16s, "
"irq = 0x%2x\n", i, pentry->name, pentry->irq);
sfi_handle_ipc_dev(pdev);