-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'next-s5pv310' into for-next
Conflicts: arch/arm/mach-s5pv310/Kconfig arch/arm/mach-s5pv310/Makefile arch/arm/mach-s5pv310/mach-smdkc210.c arch/arm/mach-s5pv310/mach-smdkv310.c arch/arm/plat-samsung/include/plat/devs.h
- Loading branch information
Showing
13 changed files
with
317 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
/* linux/arch/arm/mach-s5pv310/dev-pd.c | ||
* | ||
* Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
* http://www.samsung.com | ||
* | ||
* S5PV310 - Power Domain support | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#include <linux/io.h> | ||
#include <linux/kernel.h> | ||
#include <linux/platform_device.h> | ||
#include <linux/delay.h> | ||
|
||
#include <mach/regs-pmu.h> | ||
|
||
#include <plat/pd.h> | ||
|
||
static int s5pv310_pd_enable(struct device *dev) | ||
{ | ||
struct samsung_pd_info *pdata = dev->platform_data; | ||
u32 timeout; | ||
|
||
__raw_writel(S5P_INT_LOCAL_PWR_EN, pdata->base); | ||
|
||
/* Wait max 1ms */ | ||
timeout = 10; | ||
while ((__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) | ||
!= S5P_INT_LOCAL_PWR_EN) { | ||
if (timeout == 0) { | ||
printk(KERN_ERR "Power domain %s enable failed.\n", | ||
dev_name(dev)); | ||
return -ETIMEDOUT; | ||
} | ||
timeout--; | ||
udelay(100); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
static int s5pv310_pd_disable(struct device *dev) | ||
{ | ||
struct samsung_pd_info *pdata = dev->platform_data; | ||
u32 timeout; | ||
|
||
__raw_writel(0, pdata->base); | ||
|
||
/* Wait max 1ms */ | ||
timeout = 10; | ||
while (__raw_readl(pdata->base + 0x4) & S5P_INT_LOCAL_PWR_EN) { | ||
if (timeout == 0) { | ||
printk(KERN_ERR "Power domain %s disable failed.\n", | ||
dev_name(dev)); | ||
return -ETIMEDOUT; | ||
} | ||
timeout--; | ||
udelay(100); | ||
} | ||
|
||
return 0; | ||
} | ||
|
||
struct platform_device s5pv310_device_pd[] = { | ||
{ | ||
.name = "samsung-pd", | ||
.id = 0, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_MFC_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 1, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_G3D_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 2, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_LCD0_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 3, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_LCD1_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 4, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_TV_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 5, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_CAM_CONF, | ||
}, | ||
}, | ||
}, { | ||
.name = "samsung-pd", | ||
.id = 6, | ||
.dev = { | ||
.platform_data = &(struct samsung_pd_info) { | ||
.enable = s5pv310_pd_enable, | ||
.disable = s5pv310_pd_disable, | ||
.base = S5P_PMU_GPS_CONF, | ||
}, | ||
}, | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
/* linux/arch/arm/mach-s5pv310/include/mach/regs-pmu.h | ||
* | ||
* Copyright (c) 2010 Samsung Electronics Co., Ltd. | ||
* http://www.samsung.com | ||
* | ||
* S5PV310 - Power management unit definition | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License version 2 as | ||
* published by the Free Software Foundation. | ||
*/ | ||
|
||
#ifndef __ASM_ARCH_REGS_PMU_H | ||
#define __ASM_ARCH_REGS_PMU_H __FILE__ | ||
|
||
#include <mach/map.h> | ||
|
||
#define S5P_PMUREG(x) (S5P_VA_PMU + (x)) | ||
|
||
#define S5P_PMU_CAM_CONF S5P_PMUREG(0x3C00) | ||
#define S5P_PMU_TV_CONF S5P_PMUREG(0x3C20) | ||
#define S5P_PMU_MFC_CONF S5P_PMUREG(0x3C40) | ||
#define S5P_PMU_G3D_CONF S5P_PMUREG(0x3C60) | ||
#define S5P_PMU_LCD0_CONF S5P_PMUREG(0x3C80) | ||
#define S5P_PMU_LCD1_CONF S5P_PMUREG(0x3CA0) | ||
#define S5P_PMU_GPS_CONF S5P_PMUREG(0x3CE0) | ||
|
||
#define S5P_INT_LOCAL_PWR_EN 0x7 | ||
|
||
#endif /* __ASM_ARCH_REGS_PMU_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.