Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
424c3d4a
Commit
424c3d4a
authored
Aug 01, 2011
by
Liam Girdwood
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'for-next' into for-linus
parents
02f8c6ae
88cda60e
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
332 additions
and
215 deletions
+332
-215
drivers/regulator/core.c
drivers/regulator/core.c
+110
-80
drivers/regulator/dummy.c
drivers/regulator/dummy.c
+26
-6
drivers/regulator/tps65910-regulator.c
drivers/regulator/tps65910-regulator.c
+51
-12
drivers/regulator/twl-regulator.c
drivers/regulator/twl-regulator.c
+31
-35
drivers/regulator/wm831x-dcdc.c
drivers/regulator/wm831x-dcdc.c
+65
-61
drivers/regulator/wm831x-ldo.c
drivers/regulator/wm831x-ldo.c
+22
-3
drivers/regulator/wm8994-regulator.c
drivers/regulator/wm8994-regulator.c
+2
-2
include/linux/regulator/consumer.h
include/linux/regulator/consumer.h
+3
-0
include/linux/regulator/driver.h
include/linux/regulator/driver.h
+1
-3
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320aic3x.c
+21
-13
No files found.
drivers/regulator/core.c
View file @
424c3d4a
This diff is collapsed.
Click to expand it.
drivers/regulator/dummy.c
View file @
424c3d4a
...
...
@@ -36,6 +36,29 @@ static struct regulator_desc dummy_desc = {
.
ops
=
&
dummy_ops
,
};
static
int
__devinit
dummy_regulator_probe
(
struct
platform_device
*
pdev
)
{
int
ret
;
dummy_regulator_rdev
=
regulator_register
(
&
dummy_desc
,
NULL
,
&
dummy_initdata
,
NULL
);
if
(
IS_ERR
(
dummy_regulator_rdev
))
{
ret
=
PTR_ERR
(
dummy_regulator_rdev
);
pr_err
(
"Failed to register regulator: %d
\n
"
,
ret
);
return
ret
;
}
return
0
;
}
static
struct
platform_driver
dummy_regulator_driver
=
{
.
probe
=
dummy_regulator_probe
,
.
driver
=
{
.
name
=
"reg-dummy"
,
.
owner
=
THIS_MODULE
,
},
};
static
struct
platform_device
*
dummy_pdev
;
void
__init
regulator_dummy_init
(
void
)
...
...
@@ -55,12 +78,9 @@ void __init regulator_dummy_init(void)
return
;
}
dummy_regulator_rdev
=
regulator_register
(
&
dummy_desc
,
NULL
,
&
dummy_initdata
,
NULL
);
if
(
IS_ERR
(
dummy_regulator_rdev
))
{
ret
=
PTR_ERR
(
dummy_regulator_rdev
);
pr_err
(
"Failed to register regulator: %d
\n
"
,
ret
);
ret
=
platform_driver_register
(
&
dummy_regulator_driver
);
if
(
ret
!=
0
)
{
pr_err
(
"Failed to register dummy regulator driver: %d
\n
"
,
ret
);
platform_device_unregister
(
dummy_pdev
);
return
;
}
}
drivers/regulator/tps65910-regulator.c
View file @
424c3d4a
...
...
@@ -49,7 +49,6 @@
#define TPS65911_REG_LDO7 11
#define TPS65911_REG_LDO8 12
#define TPS65910_NUM_REGULATOR 13
#define TPS65910_SUPPLY_STATE_ENABLED 0x1
/* supported VIO voltages in milivolts */
...
...
@@ -264,11 +263,12 @@ static struct tps_info tps65911_regs[] = {
};
struct
tps65910_reg
{
struct
regulator_desc
desc
[
TPS65910_NUM_REGULATOR
]
;
struct
regulator_desc
*
desc
;
struct
tps65910
*
mfd
;
struct
regulator_dev
*
rdev
[
TPS65910_NUM_REGULATOR
]
;
struct
tps_info
*
info
[
TPS65910_NUM_REGULATOR
]
;
struct
regulator_dev
*
*
rdev
;
struct
tps_info
*
*
info
;
struct
mutex
mutex
;
int
num_regulators
;
int
mode
;
int
(
*
get_ctrl_reg
)(
int
);
};
...
...
@@ -759,8 +759,13 @@ static int tps65910_list_voltage_dcdc(struct regulator_dev *dev,
mult
=
(
selector
/
VDD1_2_NUM_VOLTS
)
+
1
;
volt
=
VDD1_2_MIN_VOLT
+
(
selector
%
VDD1_2_NUM_VOLTS
)
*
VDD1_2_OFFSET
;
break
;
case
TPS65911_REG_VDDCTRL
:
volt
=
VDDCTRL_MIN_VOLT
+
(
selector
*
VDDCTRL_OFFSET
);
break
;
default:
BUG
();
return
-
EINVAL
;
}
return
volt
*
100
*
mult
;
...
...
@@ -897,16 +902,42 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
switch
(
tps65910_chip_id
(
tps65910
))
{
case
TPS65910
:
pmic
->
get_ctrl_reg
=
&
tps65910_get_ctrl_register
;
pmic
->
num_regulators
=
ARRAY_SIZE
(
tps65910_regs
);
info
=
tps65910_regs
;
break
;
case
TPS65911
:
pmic
->
get_ctrl_reg
=
&
tps65911_get_ctrl_register
;
pmic
->
num_regulators
=
ARRAY_SIZE
(
tps65911_regs
);
info
=
tps65911_regs
;
break
;
default:
pr_err
(
"Invalid tps chip version
\n
"
);
kfree
(
pmic
);
return
-
ENODEV
;
}
for
(
i
=
0
;
i
<
TPS65910_NUM_REGULATOR
;
i
++
,
info
++
,
reg_data
++
)
{
pmic
->
desc
=
kcalloc
(
pmic
->
num_regulators
,
sizeof
(
struct
regulator_desc
),
GFP_KERNEL
);
if
(
!
pmic
->
desc
)
{
err
=
-
ENOMEM
;
goto
err_free_pmic
;
}
pmic
->
info
=
kcalloc
(
pmic
->
num_regulators
,
sizeof
(
struct
tps_info
*
),
GFP_KERNEL
);
if
(
!
pmic
->
info
)
{
err
=
-
ENOMEM
;
goto
err_free_desc
;
}
pmic
->
rdev
=
kcalloc
(
pmic
->
num_regulators
,
sizeof
(
struct
regulator_dev
*
),
GFP_KERNEL
);
if
(
!
pmic
->
rdev
)
{
err
=
-
ENOMEM
;
goto
err_free_info
;
}
for
(
i
=
0
;
i
<
pmic
->
num_regulators
;
i
++
,
info
++
,
reg_data
++
)
{
/* Register the regulators */
pmic
->
info
[
i
]
=
info
;
...
...
@@ -938,7 +969,7 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
"failed to register %s regulator
\n
"
,
pdev
->
name
);
err
=
PTR_ERR
(
rdev
);
goto
err
;
goto
err
_unregister_regulator
;
}
/* Save regulator for cleanup */
...
...
@@ -946,23 +977,31 @@ static __devinit int tps65910_probe(struct platform_device *pdev)
}
return
0
;
err:
err
_unregister_regulator
:
while
(
--
i
>=
0
)
regulator_unregister
(
pmic
->
rdev
[
i
]);
kfree
(
pmic
->
rdev
);
err_free_info:
kfree
(
pmic
->
info
);
err_free_desc:
kfree
(
pmic
->
desc
);
err_free_pmic:
kfree
(
pmic
);
return
err
;
}
static
int
__devexit
tps65910_remove
(
struct
platform_device
*
pdev
)
{
struct
tps65910_reg
*
tps65910_reg
=
platform_get_drvdata
(
pdev
);
struct
tps65910_reg
*
pmic
=
platform_get_drvdata
(
pdev
);
int
i
;
for
(
i
=
0
;
i
<
TPS65910_NUM_REGULATOR
;
i
++
)
regulator_unregister
(
tps65910_reg
->
rdev
[
i
]);
for
(
i
=
0
;
i
<
pmic
->
num_regulators
;
i
++
)
regulator_unregister
(
pmic
->
rdev
[
i
]);
kfree
(
tps65910_reg
);
kfree
(
pmic
->
rdev
);
kfree
(
pmic
->
info
);
kfree
(
pmic
->
desc
);
kfree
(
pmic
);
return
0
;
}
...
...
drivers/regulator/twl-regulator.c
View file @
424c3d4a
...
...
@@ -835,8 +835,8 @@ static struct regulator_ops twlsmps_ops = {
remap_conf) \
TWL_FIXED_LDO(label, offset, mVolts, num, turnon_delay, \
remap_conf, TWL4030, twl4030fixed_ops)
#define TWL6030_FIXED_LDO(label, offset, mVolts,
num,
turnon_delay) \
TWL_FIXED_LDO(label, offset, mVolts,
num
, turnon_delay, \
#define TWL6030_FIXED_LDO(label, offset, mVolts, turnon_delay) \
TWL_FIXED_LDO(label, offset, mVolts,
0x0
, turnon_delay, \
0x0, TWL6030, twl6030fixed_ops)
#define TWL4030_ADJUSTABLE_LDO(label, offset, num, turnon_delay, remap_conf) { \
...
...
@@ -856,24 +856,22 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts
, num
) { \
#define TWL6030_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \
.base = offset, \
.id = num, \
.min_mV = min_mVolts, \
.max_mV = max_mVolts, \
.desc = { \
.name = #label, \
.id = TWL6030_REG_##label, \
.n_voltages = (max_mVolts - min_mVolts)/100, \
.n_voltages = (max_mVolts - min_mVolts)/100
+ 1
, \
.ops = &twl6030ldo_ops, \
.type = REGULATOR_VOLTAGE, \
.owner = THIS_MODULE, \
}, \
}
#define TWL6025_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts
, num
) { \
#define TWL6025_ADJUSTABLE_LDO(label, offset, min_mVolts, max_mVolts) { \
.base = offset, \
.id = num, \
.min_mV = min_mVolts, \
.max_mV = max_mVolts, \
.desc = { \
...
...
@@ -903,9 +901,8 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
#define TWL6030_FIXED_RESOURCE(label, offset,
num,
turnon_delay) { \
#define TWL6030_FIXED_RESOURCE(label, offset, turnon_delay) { \
.base = offset, \
.id = num, \
.delay = turnon_delay, \
.desc = { \
.name = #label, \
...
...
@@ -916,9 +913,8 @@ static struct regulator_ops twlsmps_ops = {
}, \
}
#define TWL6025_ADJUSTABLE_SMPS(label, offset
, num
) { \
#define TWL6025_ADJUSTABLE_SMPS(label, offset) { \
.base = offset, \
.id = num, \
.min_mV = 600, \
.max_mV = 2100, \
.desc = { \
...
...
@@ -961,32 +957,32 @@ static struct twlreg_info twl_regs[] = {
/* 6030 REG with base as PMC Slave Misc : 0x0030 */
/* Turnon-delay and remap configuration values for 6030 are not
verified since the specification is not public */
TWL6030_ADJUSTABLE_LDO
(
VAUX1_6030
,
0x54
,
1000
,
3300
,
1
),
TWL6030_ADJUSTABLE_LDO
(
VAUX2_6030
,
0x58
,
1000
,
3300
,
2
),
TWL6030_ADJUSTABLE_LDO
(
VAUX3_6030
,
0x5c
,
1000
,
3300
,
3
),
TWL6030_ADJUSTABLE_LDO
(
VMMC
,
0x68
,
1000
,
3300
,
4
),
TWL6030_ADJUSTABLE_LDO
(
VPP
,
0x6c
,
1000
,
3300
,
5
),
TWL6030_ADJUSTABLE_LDO
(
VUSIM
,
0x74
,
1000
,
3300
,
7
),
TWL6030_FIXED_LDO
(
VANA
,
0x50
,
2100
,
15
,
0
),
TWL6030_FIXED_LDO
(
VCXIO
,
0x60
,
1800
,
16
,
0
),
TWL6030_FIXED_LDO
(
VDAC
,
0x64
,
1800
,
17
,
0
),
TWL6030_FIXED_LDO
(
VUSB
,
0x70
,
3300
,
18
,
0
),
TWL6030_FIXED_RESOURCE
(
CLK32KG
,
0x8C
,
48
,
0
),
TWL6030_ADJUSTABLE_LDO
(
VAUX1_6030
,
0x54
,
1000
,
3300
),
TWL6030_ADJUSTABLE_LDO
(
VAUX2_6030
,
0x58
,
1000
,
3300
),
TWL6030_ADJUSTABLE_LDO
(
VAUX3_6030
,
0x5c
,
1000
,
3300
),
TWL6030_ADJUSTABLE_LDO
(
VMMC
,
0x68
,
1000
,
3300
),
TWL6030_ADJUSTABLE_LDO
(
VPP
,
0x6c
,
1000
,
3300
),
TWL6030_ADJUSTABLE_LDO
(
VUSIM
,
0x74
,
1000
,
3300
),
TWL6030_FIXED_LDO
(
VANA
,
0x50
,
2100
,
0
),
TWL6030_FIXED_LDO
(
VCXIO
,
0x60
,
1800
,
0
),
TWL6030_FIXED_LDO
(
VDAC
,
0x64
,
1800
,
0
),
TWL6030_FIXED_LDO
(
VUSB
,
0x70
,
3300
,
0
),
TWL6030_FIXED_RESOURCE
(
CLK32KG
,
0x8C
,
0
),
/* 6025 are renamed compared to 6030 versions */
TWL6025_ADJUSTABLE_LDO
(
LDO2
,
0x54
,
1000
,
3300
,
1
),
TWL6025_ADJUSTABLE_LDO
(
LDO4
,
0x58
,
1000
,
3300
,
2
),
TWL6025_ADJUSTABLE_LDO
(
LDO3
,
0x5c
,
1000
,
3300
,
3
),
TWL6025_ADJUSTABLE_LDO
(
LDO5
,
0x68
,
1000
,
3300
,
4
),
TWL6025_ADJUSTABLE_LDO
(
LDO1
,
0x6c
,
1000
,
3300
,
5
),
TWL6025_ADJUSTABLE_LDO
(
LDO7
,
0x74
,
1000
,
3300
,
7
),
TWL6025_ADJUSTABLE_LDO
(
LDO6
,
0x60
,
1000
,
3300
,
16
),
TWL6025_ADJUSTABLE_LDO
(
LDOLN
,
0x64
,
1000
,
3300
,
17
),
TWL6025_ADJUSTABLE_LDO
(
LDOUSB
,
0x70
,
1000
,
3300
,
18
),
TWL6025_ADJUSTABLE_SMPS
(
SMPS3
,
0x34
,
1
),
TWL6025_ADJUSTABLE_SMPS
(
SMPS4
,
0x10
,
2
),
TWL6025_ADJUSTABLE_SMPS
(
VIO
,
0x16
,
3
),
TWL6025_ADJUSTABLE_LDO
(
LDO2
,
0x54
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO4
,
0x58
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO3
,
0x5c
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO5
,
0x68
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO1
,
0x6c
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO7
,
0x74
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDO6
,
0x60
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDOLN
,
0x64
,
1000
,
3300
),
TWL6025_ADJUSTABLE_LDO
(
LDOUSB
,
0x70
,
1000
,
3300
),
TWL6025_ADJUSTABLE_SMPS
(
SMPS3
,
0x34
),
TWL6025_ADJUSTABLE_SMPS
(
SMPS4
,
0x10
),
TWL6025_ADJUSTABLE_SMPS
(
VIO
,
0x16
),
};
static
u8
twl_get_smps_offset
(
void
)
...
...
drivers/regulator/wm831x-dcdc.c
View file @
424c3d4a
...
...
@@ -267,23 +267,6 @@ static int wm831x_buckv_select_min_voltage(struct regulator_dev *rdev,
return
vsel
;
}
static
int
wm831x_buckv_select_max_voltage
(
struct
regulator_dev
*
rdev
,
int
min_uV
,
int
max_uV
)
{
u16
vsel
;
if
(
max_uV
<
600000
||
max_uV
>
1800000
)
return
-
EINVAL
;
vsel
=
((
max_uV
-
600000
)
/
12500
)
+
8
;
if
(
wm831x_buckv_list_voltage
(
rdev
,
vsel
)
<
min_uV
||
wm831x_buckv_list_voltage
(
rdev
,
vsel
)
<
max_uV
)
return
-
EINVAL
;
return
vsel
;
}
static
int
wm831x_buckv_set_dvs
(
struct
regulator_dev
*
rdev
,
int
state
)
{
struct
wm831x_dcdc
*
dcdc
=
rdev_get_drvdata
(
rdev
);
...
...
@@ -338,28 +321,23 @@ static int wm831x_buckv_set_voltage(struct regulator_dev *rdev,
if
(
ret
<
0
)
return
ret
;
/* Set the high voltage as the DVS voltage. This is optimised
* for CPUfreq usage, most processors will keep the maximum
* voltage constant and lower the minimum with the frequency. */
vsel
=
wm831x_buckv_select_max_voltage
(
rdev
,
min_uV
,
max_uV
);
if
(
vsel
<
0
)
{
/* This should never happen - at worst the same vsel
* should be chosen */
WARN_ON
(
vsel
<
0
);
return
0
;
/*
* If this VSEL is higher than the last one we've seen then
* remember it as the DVS VSEL. This is optimised for CPUfreq
* usage where we want to get to the highest voltage very
* quickly.
*/
if
(
vsel
>
dcdc
->
dvs_vsel
)
{
ret
=
wm831x_set_bits
(
wm831x
,
dvs_reg
,
WM831X_DC1_DVS_VSEL_MASK
,
dcdc
->
dvs_vsel
);
if
(
ret
==
0
)
dcdc
->
dvs_vsel
=
vsel
;
else
dev_warn
(
wm831x
->
dev
,
"Failed to set DCDC DVS VSEL: %d
\n
"
,
ret
);
}
/* Don't bother if it's the same VSEL we're already using */
if
(
vsel
==
dcdc
->
on_vsel
)
return
0
;
ret
=
wm831x_set_bits
(
wm831x
,
dvs_reg
,
WM831X_DC1_DVS_VSEL_MASK
,
vsel
);
if
(
ret
==
0
)
dcdc
->
dvs_vsel
=
vsel
;
else
dev_warn
(
wm831x
->
dev
,
"Failed to set DCDC DVS VSEL: %d
\n
"
,
ret
);
return
0
;
}
...
...
@@ -456,27 +434,6 @@ static __devinit void wm831x_buckv_dvs_init(struct wm831x_dcdc *dcdc,
if
(
!
pdata
||
!
pdata
->
dvs_gpio
)
return
;
switch
(
pdata
->
dvs_control_src
)
{
case
1
:
ctrl
=
2
<<
WM831X_DC1_DVS_SRC_SHIFT
;
break
;
case
2
:
ctrl
=
3
<<
WM831X_DC1_DVS_SRC_SHIFT
;
break
;
default:
dev_err
(
wm831x
->
dev
,
"Invalid DVS control source %d for %s
\n
"
,
pdata
->
dvs_control_src
,
dcdc
->
name
);
return
;
}
ret
=
wm831x_set_bits
(
wm831x
,
dcdc
->
base
+
WM831X_DCDC_DVS_CONTROL
,
WM831X_DC1_DVS_SRC_MASK
,
ctrl
);
if
(
ret
<
0
)
{
dev_err
(
wm831x
->
dev
,
"Failed to set %s DVS source: %d
\n
"
,
dcdc
->
name
,
ret
);
return
;
}
ret
=
gpio_request
(
pdata
->
dvs_gpio
,
"DCDC DVS"
);
if
(
ret
<
0
)
{
dev_err
(
wm831x
->
dev
,
"Failed to get %s DVS GPIO: %d
\n
"
,
...
...
@@ -498,17 +455,57 @@ static __devinit void wm831x_buckv_dvs_init(struct wm831x_dcdc *dcdc,
}
dcdc
->
dvs_gpio
=
pdata
->
dvs_gpio
;
switch
(
pdata
->
dvs_control_src
)
{
case
1
:
ctrl
=
2
<<
WM831X_DC1_DVS_SRC_SHIFT
;
break
;
case
2
:
ctrl
=
3
<<
WM831X_DC1_DVS_SRC_SHIFT
;
break
;
default:
dev_err
(
wm831x
->
dev
,
"Invalid DVS control source %d for %s
\n
"
,
pdata
->
dvs_control_src
,
dcdc
->
name
);
return
;
}
/* If DVS_VSEL is set to the minimum value then raise it to ON_VSEL
* to make bootstrapping a bit smoother.
*/
if
(
!
dcdc
->
dvs_vsel
)
{
ret
=
wm831x_set_bits
(
wm831x
,
dcdc
->
base
+
WM831X_DCDC_DVS_CONTROL
,
WM831X_DC1_DVS_VSEL_MASK
,
dcdc
->
on_vsel
);
if
(
ret
==
0
)
dcdc
->
dvs_vsel
=
dcdc
->
on_vsel
;
else
dev_warn
(
wm831x
->
dev
,
"Failed to set DVS_VSEL: %d
\n
"
,
ret
);
}
ret
=
wm831x_set_bits
(
wm831x
,
dcdc
->
base
+
WM831X_DCDC_DVS_CONTROL
,
WM831X_DC1_DVS_SRC_MASK
,
ctrl
);
if
(
ret
<
0
)
{
dev_err
(
wm831x
->
dev
,
"Failed to set %s DVS source: %d
\n
"
,
dcdc
->
name
,
ret
);
}
}
static
__devinit
int
wm831x_buckv_probe
(
struct
platform_device
*
pdev
)
{
struct
wm831x
*
wm831x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
wm831x_pdata
*
pdata
=
wm831x
->
dev
->
platform_data
;
int
id
=
pdev
->
id
%
ARRAY_SIZE
(
pdata
->
dcdc
)
;
int
id
;
struct
wm831x_dcdc
*
dcdc
;
struct
resource
*
res
;
int
ret
,
irq
;
if
(
pdata
&&
pdata
->
wm831x_num
)
id
=
(
pdata
->
wm831x_num
*
10
)
+
1
;
else
id
=
0
;
id
=
pdev
->
id
-
id
;
dev_dbg
(
&
pdev
->
dev
,
"Probing DCDC%d
\n
"
,
id
+
1
);
if
(
pdata
==
NULL
||
pdata
->
dcdc
[
id
]
==
NULL
)
...
...
@@ -545,7 +542,7 @@ static __devinit int wm831x_buckv_probe(struct platform_device *pdev)
}
dcdc
->
on_vsel
=
ret
&
WM831X_DC1_ON_VSEL_MASK
;
ret
=
wm831x_reg_read
(
wm831x
,
dcdc
->
base
+
WM831X_DCDC_
ON_CONFIG
);
ret
=
wm831x_reg_read
(
wm831x
,
dcdc
->
base
+
WM831X_DCDC_
DVS_CONTROL
);
if
(
ret
<
0
)
{
dev_err
(
wm831x
->
dev
,
"Failed to read DVS VSEL: %d
\n
"
,
ret
);
goto
err
;
...
...
@@ -709,11 +706,17 @@ static __devinit int wm831x_buckp_probe(struct platform_device *pdev)
{
struct
wm831x
*
wm831x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
wm831x_pdata
*
pdata
=
wm831x
->
dev
->
platform_data
;
int
id
=
pdev
->
id
%
ARRAY_SIZE
(
pdata
->
dcdc
)
;
int
id
;
struct
wm831x_dcdc
*
dcdc
;
struct
resource
*
res
;
int
ret
,
irq
;
if
(
pdata
&&
pdata
->
wm831x_num
)
id
=
(
pdata
->
wm831x_num
*
10
)
+
1
;
else
id
=
0
;
id
=
pdev
->
id
-
id
;
dev_dbg
(
&
pdev
->
dev
,
"Probing DCDC%d
\n
"
,
id
+
1
);
if
(
pdata
==
NULL
||
pdata
->
dcdc
[
id
]
==
NULL
)
...
...
@@ -1046,3 +1049,4 @@ MODULE_DESCRIPTION("WM831x DC-DC convertor driver");
MODULE_LICENSE
(
"GPL"
);
MODULE_ALIAS
(
"platform:wm831x-buckv"
);
MODULE_ALIAS
(
"platform:wm831x-buckp"
);
MODULE_ALIAS
(
"platform:wm831x-epe"
);
drivers/regulator/wm831x-ldo.c
View file @
424c3d4a
...
...
@@ -310,11 +310,17 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
{
struct
wm831x
*
wm831x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
wm831x_pdata
*
pdata
=
wm831x
->
dev
->
platform_data
;
int
id
=
pdev
->
id
%
ARRAY_SIZE
(
pdata
->
ldo
)
;
int
id
;
struct
wm831x_ldo
*
ldo
;
struct
resource
*
res
;
int
ret
,
irq
;
if
(
pdata
&&
pdata
->
wm831x_num
)
id
=
(
pdata
->
wm831x_num
*
10
)
+
1
;
else
id
=
0
;
id
=
pdev
->
id
-
id
;
dev_dbg
(
&
pdev
->
dev
,
"Probing LDO%d
\n
"
,
id
+
1
);
if
(
pdata
==
NULL
||
pdata
->
ldo
[
id
]
==
NULL
)
...
...
@@ -574,11 +580,17 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev)
{
struct
wm831x
*
wm831x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
wm831x_pdata
*
pdata
=
wm831x
->
dev
->
platform_data
;
int
id
=
pdev
->
id
%
ARRAY_SIZE
(
pdata
->
ldo
)
;
int
id
;
struct
wm831x_ldo
*
ldo
;
struct
resource
*
res
;
int
ret
,
irq
;
if
(
pdata
&&
pdata
->
wm831x_num
)
id
=
(
pdata
->
wm831x_num
*
10
)
+
1
;
else
id
=
0
;
id
=
pdev
->
id
-
id
;
dev_dbg
(
&
pdev
->
dev
,
"Probing LDO%d
\n
"
,
id
+
1
);
if
(
pdata
==
NULL
||
pdata
->
ldo
[
id
]
==
NULL
)
...
...
@@ -764,11 +776,18 @@ static __devinit int wm831x_alive_ldo_probe(struct platform_device *pdev)
{
struct
wm831x
*
wm831x
=
dev_get_drvdata
(
pdev
->
dev
.
parent
);
struct
wm831x_pdata
*
pdata
=
wm831x
->
dev
->
platform_data
;
int
id
=
pdev
->
id
%
ARRAY_SIZE
(
pdata
->
ldo
)
;
int
id
;
struct
wm831x_ldo
*
ldo
;
struct
resource
*
res
;
int
ret
;
if
(
pdata
&&
pdata
->
wm831x_num
)
id
=
(
pdata
->
wm831x_num
*
10
)
+
1
;
else
id
=
0
;
id
=
pdev
->
id
-
id
;
dev_dbg
(
&
pdev
->
dev
,
"Probing LDO%d
\n
"
,
id
+
1
);
if
(
pdata
==
NULL
||
pdata
->
ldo
[
id
]
==
NULL
)
...
...
drivers/regulator/wm8994-regulator.c
View file @
424c3d4a
...
...
@@ -43,7 +43,7 @@ static int wm8994_ldo_enable(struct regulator_dev *rdev)
if
(
!
ldo
->
enable
)
return
0
;
gpio_set_value
(
ldo
->
enable
,
1
);
gpio_set_value
_cansleep
(
ldo
->
enable
,
1
);
ldo
->
is_enabled
=
true
;
return
0
;
...
...
@@ -57,7 +57,7 @@ static int wm8994_ldo_disable(struct regulator_dev *rdev)
if
(
!
ldo
->
enable
)
return
-
EINVAL
;
gpio_set_value
(
ldo
->
enable
,
0
);
gpio_set_value
_cansleep
(
ldo
->
enable
,
0
);
ldo
->
is_enabled
=
false
;
return
0
;
...
...
include/linux/regulator/consumer.h
View file @
424c3d4a
...
...
@@ -122,6 +122,9 @@ struct regulator;
struct
regulator_bulk_data
{
const
char
*
supply
;
struct
regulator
*
consumer
;
/* Internal use */
int
ret
;
};
#if defined(CONFIG_REGULATOR)
...
...
include/linux/regulator/driver.h
View file @
424c3d4a
...
...
@@ -188,18 +188,16 @@ struct regulator_dev {
/* lists we belong to */
struct
list_head
list
;
/* list of all regulators */
struct
list_head
slist
;
/* list of supplied regulators */
/* lists we own */
struct
list_head
consumer_list
;
/* consumers we supply */
struct
list_head
supply_list
;
/* regulators we supply */
struct
blocking_notifier_head
notifier
;
struct
mutex
mutex
;
/* consumer lock */
struct
module
*
owner
;
struct
device
dev
;
struct
regulation_constraints
*
constraints
;
struct
regulator
_dev
*
supply
;
/* for tree */
struct
regulator
*
supply
;
/* for tree */
void
*
reg_data
;
/* regulator_dev data */
...
...
sound/soc/codecs/tlv320aic3x.c
View file @
424c3d4a
...
...
@@ -226,11 +226,13 @@ static const char *aic3x_adc_hpf[] =
#define RDAC_ENUM 1
#define LHPCOM_ENUM 2
#define RHPCOM_ENUM 3
#define LINE1L_ENUM 4
#define LINE1R_ENUM 5
#define LINE2L_ENUM 6
#define LINE2R_ENUM 7
#define ADC_HPF_ENUM 8
#define LINE1L_2_L_ENUM 4
#define LINE1L_2_R_ENUM 5
#define LINE1R_2_L_ENUM 6
#define LINE1R_2_R_ENUM 7
#define LINE2L_ENUM 8
#define LINE2R_ENUM 9
#define ADC_HPF_ENUM 10
static
const
struct
soc_enum
aic3x_enum
[]
=
{
SOC_ENUM_SINGLE
(
DAC_LINE_MUX
,
6
,
3
,
aic3x_left_dac_mux
),
...
...
@@ -238,6 +240,8 @@ static const struct soc_enum aic3x_enum[] = {
SOC_ENUM_SINGLE
(
HPLCOM_CFG
,
4
,
3
,
aic3x_left_hpcom_mux
),
SOC_ENUM_SINGLE
(
HPRCOM_CFG
,
3
,
5
,
aic3x_right_hpcom_mux
),
SOC_ENUM_SINGLE
(
LINE1L_2_LADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
SOC_ENUM_SINGLE
(
LINE1L_2_RADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
SOC_ENUM_SINGLE
(
LINE1R_2_LADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
SOC_ENUM_SINGLE
(
LINE1R_2_RADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
SOC_ENUM_SINGLE
(
LINE2L_2_LADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
SOC_ENUM_SINGLE
(
LINE2R_2_RADC_CTRL
,
7
,
2
,
aic3x_linein_mode_mux
),
...
...
@@ -490,12 +494,16 @@ static const struct snd_kcontrol_new aic3x_right_pga_mixer_controls[] = {
};
/* Left Line1 Mux */
static
const
struct
snd_kcontrol_new
aic3x_left_line1_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1L_ENUM
]);
static
const
struct
snd_kcontrol_new
aic3x_left_line1l_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1L_2_L_ENUM
]);
static
const
struct
snd_kcontrol_new
aic3x_right_line1l_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1L_2_R_ENUM
]);
/* Right Line1 Mux */
static
const
struct
snd_kcontrol_new
aic3x_right_line1_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1R_ENUM
]);
static
const
struct
snd_kcontrol_new
aic3x_right_line1r_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1R_2_R_ENUM
]);
static
const
struct
snd_kcontrol_new
aic3x_left_line1r_mux_controls
=
SOC_DAPM_ENUM
(
"Route"
,
aic3x_enum
[
LINE1R_2_L_ENUM
]);
/* Left Line2 Mux */
static
const
struct
snd_kcontrol_new
aic3x_left_line2_mux_controls
=
...
...
@@ -535,9 +543,9 @@ static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
&
aic3x_left_pga_mixer_controls
[
0
],
ARRAY_SIZE
(
aic3x_left_pga_mixer_controls
)),
SND_SOC_DAPM_MUX
(
"Left Line1L Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_left_line1_mux_controls
),
&
aic3x_left_line1
l
_mux_controls
),
SND_SOC_DAPM_MUX
(
"Left Line1R Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_left_line1_mux_controls
),
&
aic3x_left_line1
r
_mux_controls
),
SND_SOC_DAPM_MUX
(
"Left Line2L Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_left_line2_mux_controls
),
...
...
@@ -548,9 +556,9 @@ static const struct snd_soc_dapm_widget aic3x_dapm_widgets[] = {
&
aic3x_right_pga_mixer_controls
[
0
],
ARRAY_SIZE
(
aic3x_right_pga_mixer_controls
)),
SND_SOC_DAPM_MUX
(
"Right Line1L Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_right_line1_mux_controls
),
&
aic3x_right_line1
l
_mux_controls
),
SND_SOC_DAPM_MUX
(
"Right Line1R Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_right_line1_mux_controls
),
&
aic3x_right_line1
r
_mux_controls
),
SND_SOC_DAPM_MUX
(
"Right Line2R Mux"
,
SND_SOC_NOPM
,
0
,
0
,
&
aic3x_right_line2_mux_controls
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment