You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
Merge tag 'asoc-3.7' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Additional updates for v3.7 A couple more updates for 3.7, enhancements to the ux500 and wm2000 drivers, a new driver for DA9055 and the support for regulator bypass mode. With the exception of the DA9055 this has all had a chance to soak in -next (the driver was added on Friday so should be in -next today).
This commit is contained in:
@@ -349,3 +349,24 @@ Description:
|
||||
|
||||
This will be one of the same strings reported by
|
||||
the "state" attribute.
|
||||
|
||||
What: /sys/class/regulator/.../bypass
|
||||
Date: September 2012
|
||||
KernelVersion: 3.7
|
||||
Contact: Mark Brown <broonie@opensource.wolfsonmicro.com>
|
||||
Description:
|
||||
Some regulator directories will contain a field called
|
||||
bypass. This indicates if the device is in bypass mode.
|
||||
|
||||
This will be one of the following strings:
|
||||
|
||||
'enabled'
|
||||
'disabled'
|
||||
'unknown'
|
||||
|
||||
'enabled' means the regulator is in bypass mode.
|
||||
|
||||
'disabled' means that the regulator is regulating.
|
||||
|
||||
'unknown' means software cannot determine the state, or
|
||||
the reported state is invalid.
|
||||
|
||||
@@ -0,0 +1,36 @@
|
||||
Cirrus Logic CS4271 DT bindings
|
||||
|
||||
This driver supports both the I2C and the SPI bus.
|
||||
|
||||
Required properties:
|
||||
|
||||
- compatible: "cirrus,cs4271"
|
||||
|
||||
For required properties on SPI, please consult
|
||||
Documentation/devicetree/bindings/spi/spi-bus.txt
|
||||
|
||||
Required properties on I2C:
|
||||
|
||||
- reg: the i2c address
|
||||
|
||||
|
||||
Optional properties:
|
||||
|
||||
- reset-gpio: a GPIO spec to define which pin is connected to the chip's
|
||||
!RESET pin
|
||||
|
||||
Examples:
|
||||
|
||||
codec_i2c: cs4271@10 {
|
||||
compatible = "cirrus,cs4271";
|
||||
reg = <0x10>;
|
||||
reset-gpio = <&gpio 23 0>;
|
||||
};
|
||||
|
||||
codec_spi: cs4271@0 {
|
||||
compatible = "cirrus,cs4271";
|
||||
reg = <0x0>;
|
||||
reset-gpio = <&gpio 23 0>;
|
||||
spi-max-frequency = <6000000>;
|
||||
};
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
* MOP500 Audio Machine Driver
|
||||
|
||||
This node is responsible for linking together all ux500 Audio Driver components.
|
||||
|
||||
Required properties:
|
||||
- compatible : "stericsson,snd-soc-mop500"
|
||||
|
||||
Non-standard properties:
|
||||
- stericsson,cpu-dai : Phandle to the CPU-side DAI
|
||||
- stericsson,audio-codec : Phandle to the Audio CODEC
|
||||
- stericsson,card-name : Over-ride default card name
|
||||
|
||||
Example:
|
||||
|
||||
sound {
|
||||
compatible = "stericsson,snd-soc-mop500";
|
||||
|
||||
stericsson,cpu-dai = <&msp1 &msp3>;
|
||||
stericsson,audio-codec = <&codec>;
|
||||
};
|
||||
|
||||
msp1: msp@80124000 {
|
||||
compatible = "stericsson,ux500-msp-i2s";
|
||||
reg = <0x80124000 0x1000>;
|
||||
interrupts = <0 62 0x4>;
|
||||
v-ape-supply = <&db8500_vape_reg>;
|
||||
};
|
||||
|
||||
msp3: msp@80125000 {
|
||||
compatible = "stericsson,ux500-msp-i2s";
|
||||
reg = <0x80125000 0x1000>;
|
||||
interrupts = <0 62 0x4>;
|
||||
v-ape-supply = <&db8500_vape_reg>;
|
||||
};
|
||||
|
||||
codec: ab8500-codec {
|
||||
compatible = "stericsson,ab8500-codec";
|
||||
stericsson,earpeice-cmv = <950>; /* Units in mV. */
|
||||
};
|
||||
@@ -0,0 +1,43 @@
|
||||
* ux500 MSP (CPU-side Digital Audio Interface)
|
||||
|
||||
Required properties:
|
||||
- compatible :"stericsson,ux500-msp-i2s"
|
||||
- reg : Physical base address and length of the device's registers.
|
||||
|
||||
Optional properties:
|
||||
- interrupts : The interrupt output from the device.
|
||||
- interrupt-parent : The parent interrupt controller.
|
||||
- <name>-supply : Phandle to the regulator <name> supply
|
||||
|
||||
Example:
|
||||
|
||||
sound {
|
||||
compatible = "stericsson,snd-soc-mop500";
|
||||
|
||||
stericsson,platform-pcm-dma = <&pcm>;
|
||||
stericsson,cpu-dai = <&msp1 &msp3>;
|
||||
stericsson,audio-codec = <&codec>;
|
||||
};
|
||||
|
||||
pcm: ux500-pcm {
|
||||
compatible = "stericsson,ux500-pcm";
|
||||
};
|
||||
|
||||
msp1: msp@80124000 {
|
||||
compatible = "stericsson,ux500-msp-i2s";
|
||||
reg = <0x80124000 0x1000>;
|
||||
interrupts = <0 62 0x4>;
|
||||
v-ape-supply = <&db8500_vape_reg>;
|
||||
};
|
||||
|
||||
msp3: msp@80125000 {
|
||||
compatible = "stericsson,ux500-msp-i2s";
|
||||
reg = <0x80125000 0x1000>;
|
||||
interrupts = <0 62 0x4>;
|
||||
v-ape-supply = <&db8500_vape_reg>;
|
||||
};
|
||||
|
||||
codec: ab8500-codec {
|
||||
compatible = "stericsson,ab8500-codec";
|
||||
stericsson,earpeice-cmv = <950>; /* Units in mV. */
|
||||
};
|
||||
@@ -348,4 +348,5 @@ void __init eukrea_mbimx27_baseboard_init(void)
|
||||
imx27_add_imx_keypad(&eukrea_mbimx27_keymap_data);
|
||||
|
||||
gpio_led_register_device(-1, &eukrea_mbimx27_gpio_led_info);
|
||||
imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -306,4 +306,5 @@ void __init eukrea_mbimxsd25_baseboard_init(void)
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -315,4 +315,5 @@ void __init eukrea_mbimxsd35_baseboard_init(void)
|
||||
platform_add_devices(platform_devices, ARRAY_SIZE(platform_devices));
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd_button_data);
|
||||
imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -228,4 +228,5 @@ void __init eukrea_mbimxsd51_baseboard_init(void)
|
||||
|
||||
gpio_led_register_device(-1, &eukrea_mbimxsd51_led_info);
|
||||
imx_add_gpio_keys(&eukrea_mbimxsd51_button_data);
|
||||
imx_add_platform_device("eukrea_tlv320", 0, NULL, 0, NULL, 0);
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/gpio.h>
|
||||
#include <linux/pinctrl/consumer.h>
|
||||
|
||||
#include <plat/gpio-nomadik.h>
|
||||
#include <plat/pincfg.h>
|
||||
@@ -23,53 +22,6 @@
|
||||
#include "devices-db8500.h"
|
||||
#include "pins-db8500.h"
|
||||
|
||||
/* MSP1/3 Tx/Rx usage protection */
|
||||
static DEFINE_SPINLOCK(msp_rxtx_lock);
|
||||
|
||||
/* Reference Count */
|
||||
static int msp_rxtx_ref;
|
||||
|
||||
/* Pin modes */
|
||||
struct pinctrl *msp1_p;
|
||||
struct pinctrl_state *msp1_def;
|
||||
struct pinctrl_state *msp1_sleep;
|
||||
|
||||
int msp13_i2s_init(void)
|
||||
{
|
||||
int retval = 0;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&msp_rxtx_lock, flags);
|
||||
if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_def))) {
|
||||
retval = pinctrl_select_state(msp1_p, msp1_def);
|
||||
if (retval)
|
||||
pr_err("could not set MSP1 defstate\n");
|
||||
}
|
||||
if (!retval)
|
||||
msp_rxtx_ref++;
|
||||
spin_unlock_irqrestore(&msp_rxtx_lock, flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
int msp13_i2s_exit(void)
|
||||
{
|
||||
int retval = 0;
|
||||
unsigned long flags;
|
||||
|
||||
spin_lock_irqsave(&msp_rxtx_lock, flags);
|
||||
WARN_ON(!msp_rxtx_ref);
|
||||
msp_rxtx_ref--;
|
||||
if (msp_rxtx_ref == 0 && !(IS_ERR(msp1_p) || IS_ERR(msp1_sleep))) {
|
||||
retval = pinctrl_select_state(msp1_p, msp1_sleep);
|
||||
if (retval)
|
||||
pr_err("could not set MSP1 sleepstate\n");
|
||||
}
|
||||
spin_unlock_irqrestore(&msp_rxtx_lock, flags);
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static struct stedma40_chan_cfg msp0_dma_rx = {
|
||||
.high_priority = true,
|
||||
.dir = STEDMA40_PERIPH_TO_MEM,
|
||||
@@ -132,8 +84,6 @@ static struct msp_i2s_platform_data msp1_platform_data = {
|
||||
.id = MSP_I2S_1,
|
||||
.msp_i2s_dma_rx = NULL,
|
||||
.msp_i2s_dma_tx = &msp1_dma_tx,
|
||||
.msp_i2s_init = msp13_i2s_init,
|
||||
.msp_i2s_exit = msp13_i2s_exit,
|
||||
};
|
||||
|
||||
static struct stedma40_chan_cfg msp2_dma_rx = {
|
||||
@@ -219,49 +169,22 @@ static struct msp_i2s_platform_data msp3_platform_data = {
|
||||
.id = MSP_I2S_3,
|
||||
.msp_i2s_dma_rx = &msp1_dma_rx,
|
||||
.msp_i2s_dma_tx = NULL,
|
||||
.msp_i2s_init = msp13_i2s_init,
|
||||
.msp_i2s_exit = msp13_i2s_exit,
|
||||
};
|
||||
|
||||
int mop500_msp_init(struct device *parent)
|
||||
{
|
||||
struct platform_device *msp1;
|
||||
|
||||
pr_info("%s: Register platform-device 'snd-soc-mop500'.\n", __func__);
|
||||
platform_device_register(&snd_soc_mop500);
|
||||
|
||||
pr_info("Initialize MSP I2S-devices.\n");
|
||||
db8500_add_msp_i2s(parent, 0, U8500_MSP0_BASE, IRQ_DB8500_MSP0,
|
||||
&msp0_platform_data);
|
||||
msp1 = db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1,
|
||||
db8500_add_msp_i2s(parent, 1, U8500_MSP1_BASE, IRQ_DB8500_MSP1,
|
||||
&msp1_platform_data);
|
||||
db8500_add_msp_i2s(parent, 2, U8500_MSP2_BASE, IRQ_DB8500_MSP2,
|
||||
&msp2_platform_data);
|
||||
db8500_add_msp_i2s(parent, 3, U8500_MSP3_BASE, IRQ_DB8500_MSP1,
|
||||
&msp3_platform_data);
|
||||
|
||||
/* Get the pinctrl handle for MSP1 */
|
||||
if (msp1) {
|
||||
msp1_p = pinctrl_get(&msp1->dev);
|
||||
if (IS_ERR(msp1_p))
|
||||
dev_err(&msp1->dev, "could not get MSP1 pinctrl\n");
|
||||
else {
|
||||
msp1_def = pinctrl_lookup_state(msp1_p,
|
||||
PINCTRL_STATE_DEFAULT);
|
||||
if (IS_ERR(msp1_def)) {
|
||||
dev_err(&msp1->dev,
|
||||
"could not get MSP1 defstate\n");
|
||||
}
|
||||
msp1_sleep = pinctrl_lookup_state(msp1_p,
|
||||
PINCTRL_STATE_SLEEP);
|
||||
if (IS_ERR(msp1_sleep))
|
||||
dev_err(&msp1->dev,
|
||||
"could not get MSP1 idlestate\n");
|
||||
}
|
||||
}
|
||||
|
||||
pr_info("%s: Register platform-device 'ux500-pcm'\n", __func__);
|
||||
platform_device_register(&ux500_pcm);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -22,8 +22,6 @@ struct msp_i2s_platform_data {
|
||||
enum msp_i2s_id id;
|
||||
struct stedma40_chan_cfg *msp_i2s_dma_rx;
|
||||
struct stedma40_chan_cfg *msp_i2s_dma_tx;
|
||||
int (*msp_i2s_init) (void);
|
||||
int (*msp_i2s_exit) (void);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -434,6 +434,11 @@ static int __devinit arizona_extcon_probe(struct platform_device *pdev)
|
||||
regmap_update_bits(arizona->regmap, ARIZONA_JACK_DETECT_ANALOGUE,
|
||||
ARIZONA_JD1_ENA, ARIZONA_JD1_ENA);
|
||||
|
||||
ret = regulator_allow_bypass(info->micvdd, true);
|
||||
if (ret != 0)
|
||||
dev_warn(arizona->dev, "Failed to set MICVDD to bypass: %d\n",
|
||||
ret);
|
||||
|
||||
pm_runtime_put(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
|
||||
@@ -39,6 +39,8 @@ static struct regulator_ops arizona_ldo1_ops = {
|
||||
.map_voltage = regulator_map_voltage_linear,
|
||||
.get_voltage_sel = regulator_get_voltage_sel_regmap,
|
||||
.set_voltage_sel = regulator_set_voltage_sel_regmap,
|
||||
.get_bypass = regulator_get_bypass_regmap,
|
||||
.set_bypass = regulator_set_bypass_regmap,
|
||||
};
|
||||
|
||||
static const struct regulator_desc arizona_ldo1 = {
|
||||
@@ -49,6 +51,8 @@ static const struct regulator_desc arizona_ldo1 = {
|
||||
|
||||
.vsel_reg = ARIZONA_LDO1_CONTROL_1,
|
||||
.vsel_mask = ARIZONA_LDO1_VSEL_MASK,
|
||||
.bypass_reg = ARIZONA_LDO1_CONTROL_1,
|
||||
.bypass_mask = ARIZONA_LDO1_BYPASS,
|
||||
.min_uV = 900000,
|
||||
.uV_step = 50000,
|
||||
.n_voltages = 7,
|
||||
|
||||
@@ -82,6 +82,9 @@ static struct regulator_ops arizona_micsupp_ops = {
|
||||
|
||||
.get_voltage_sel = regulator_get_voltage_sel_regmap,
|
||||
.set_voltage_sel = regulator_set_voltage_sel_regmap,
|
||||
|
||||
.get_bypass = regulator_get_bypass_regmap,
|
||||
.set_bypass = regulator_set_bypass_regmap,
|
||||
};
|
||||
|
||||
static const struct regulator_desc arizona_micsupp = {
|
||||
@@ -95,6 +98,8 @@ static const struct regulator_desc arizona_micsupp = {
|
||||
.vsel_mask = ARIZONA_LDO2_VSEL_MASK,
|
||||
.enable_reg = ARIZONA_MIC_CHARGE_PUMP_1,
|
||||
.enable_mask = ARIZONA_CPMIC_ENA,
|
||||
.bypass_reg = ARIZONA_MIC_CHARGE_PUMP_1,
|
||||
.bypass_mask = ARIZONA_CPMIC_BYPASS,
|
||||
|
||||
.owner = THIS_MODULE,
|
||||
};
|
||||
|
||||
@@ -77,6 +77,7 @@ struct regulator {
|
||||
struct device *dev;
|
||||
struct list_head list;
|
||||
unsigned int always_on:1;
|
||||
unsigned int bypass:1;
|
||||
int uA_load;
|
||||
int min_uV;
|
||||
int max_uV;
|
||||
@@ -394,6 +395,9 @@ static ssize_t regulator_status_show(struct device *dev,
|
||||
case REGULATOR_STATUS_STANDBY:
|
||||
label = "standby";
|
||||
break;
|
||||
case REGULATOR_STATUS_BYPASS:
|
||||
label = "bypass";
|
||||
break;
|
||||
case REGULATOR_STATUS_UNDEFINED:
|
||||
label = "undefined";
|
||||
break;
|
||||
@@ -585,6 +589,27 @@ static ssize_t regulator_suspend_standby_state_show(struct device *dev,
|
||||
static DEVICE_ATTR(suspend_standby_state, 0444,
|
||||
regulator_suspend_standby_state_show, NULL);
|
||||
|
||||
static ssize_t regulator_bypass_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf)
|
||||
{
|
||||
struct regulator_dev *rdev = dev_get_drvdata(dev);
|
||||
const char *report;
|
||||
bool bypass;
|
||||
int ret;
|
||||
|
||||
ret = rdev->desc->ops->get_bypass(rdev, &bypass);
|
||||
|
||||
if (ret != 0)
|
||||
report = "unknown";
|
||||
else if (bypass)
|
||||
report = "enabled";
|
||||
else
|
||||
report = "disabled";
|
||||
|
||||
return sprintf(buf, "%s\n", report);
|
||||
}
|
||||
static DEVICE_ATTR(bypass, 0444,
|
||||
regulator_bypass_show, NULL);
|
||||
|
||||
/*
|
||||
* These are the only attributes are present for all regulators.
|
||||
@@ -2673,6 +2698,100 @@ out:
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(regulator_set_optimum_mode);
|
||||
|
||||
/**
|
||||
* regulator_set_bypass_regmap - Default set_bypass() using regmap
|
||||
*
|
||||
* @rdev: device to operate on.
|
||||
* @enable: state to set.
|
||||
*/
|
||||
int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable)
|
||||
{
|
||||
unsigned int val;
|
||||
|
||||
if (enable)
|
||||
val = rdev->desc->bypass_mask;
|
||||
else
|
||||
val = 0;
|
||||
|
||||
return regmap_update_bits(rdev->regmap, rdev->desc->bypass_reg,
|
||||
rdev->desc->bypass_mask, val);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(regulator_set_bypass_regmap);
|
||||
|
||||
/**
|
||||
* regulator_get_bypass_regmap - Default get_bypass() using regmap
|
||||
*
|
||||
* @rdev: device to operate on.
|
||||
* @enable: current state.
|
||||
*/
|
||||
int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable)
|
||||
{
|
||||
unsigned int val;
|
||||
int ret;
|
||||
|
||||
ret = regmap_read(rdev->regmap, rdev->desc->bypass_reg, &val);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
*enable = val & rdev->desc->bypass_mask;
|
||||
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(regulator_get_bypass_regmap);
|
||||
|
||||
/**
|
||||
* regulator_allow_bypass - allow the regulator to go into bypass mode
|
||||
*
|
||||
* @regulator: Regulator to configure
|
||||
* @allow: enable or disable bypass mode
|
||||
*
|
||||
* Allow the regulator to go into bypass mode if all other consumers
|
||||
* for the regulator also enable bypass mode and the machine
|
||||
* constraints allow this. Bypass mode means that the regulator is
|
||||
* simply passing the input directly to the output with no regulation.
|
||||
*/
|
||||
int regulator_allow_bypass(struct regulator *regulator, bool enable)
|
||||
{
|
||||
struct regulator_dev *rdev = regulator->rdev;
|
||||
int ret = 0;
|
||||
|
||||
if (!rdev->desc->ops->set_bypass)
|
||||
return 0;
|
||||
|
||||
if (rdev->constraints &&
|
||||
!(rdev->constraints->valid_ops_mask & REGULATOR_CHANGE_BYPASS))
|
||||
return 0;
|
||||
|
||||
mutex_lock(&rdev->mutex);
|
||||
|
||||
if (enable && !regulator->bypass) {
|
||||
rdev->bypass_count++;
|
||||
|
||||
if (rdev->bypass_count == rdev->open_count) {
|
||||
ret = rdev->desc->ops->set_bypass(rdev, enable);
|
||||
if (ret != 0)
|
||||
rdev->bypass_count--;
|
||||
}
|
||||
|
||||
} else if (!enable && regulator->bypass) {
|
||||
rdev->bypass_count--;
|
||||
|
||||
if (rdev->bypass_count != rdev->open_count) {
|
||||
ret = rdev->desc->ops->set_bypass(rdev, enable);
|
||||
if (ret != 0)
|
||||
rdev->bypass_count++;
|
||||
}
|
||||
}
|
||||
|
||||
if (ret == 0)
|
||||
regulator->bypass = enable;
|
||||
|
||||
mutex_unlock(&rdev->mutex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(regulator_allow_bypass);
|
||||
|
||||
/**
|
||||
* regulator_register_notifier - register regulator event notifier
|
||||
* @regulator: regulator source
|
||||
@@ -3036,6 +3155,11 @@ static int add_regulator_attributes(struct regulator_dev *rdev)
|
||||
if (status < 0)
|
||||
return status;
|
||||
}
|
||||
if (ops->get_bypass) {
|
||||
status = device_create_file(dev, &dev_attr_bypass);
|
||||
if (status < 0)
|
||||
return status;
|
||||
}
|
||||
|
||||
/* some attributes are type-specific */
|
||||
if (rdev->desc->type == REGULATOR_CURRENT) {
|
||||
@@ -3124,6 +3248,8 @@ static void rdev_init_debugfs(struct regulator_dev *rdev)
|
||||
&rdev->use_count);
|
||||
debugfs_create_u32("open_count", 0444, rdev->debugfs,
|
||||
&rdev->open_count);
|
||||
debugfs_create_u32("bypass_count", 0444, rdev->debugfs,
|
||||
&rdev->bypass_count);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -237,6 +237,8 @@ static struct regulator_ops wm831x_gp_ldo_ops = {
|
||||
.set_mode = wm831x_gp_ldo_set_mode,
|
||||
.get_status = wm831x_gp_ldo_get_status,
|
||||
.get_optimum_mode = wm831x_gp_ldo_get_optimum_mode,
|
||||
.get_bypass = regulator_get_bypass_regmap,
|
||||
.set_bypass = regulator_set_bypass_regmap,
|
||||
|
||||
.is_enabled = regulator_is_enabled_regmap,
|
||||
.enable = regulator_enable_regmap,
|
||||
@@ -293,6 +295,8 @@ static __devinit int wm831x_gp_ldo_probe(struct platform_device *pdev)
|
||||
ldo->desc.vsel_mask = WM831X_LDO1_ON_VSEL_MASK;
|
||||
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
|
||||
ldo->desc.enable_mask = 1 << id;
|
||||
ldo->desc.bypass_reg = ldo->base;
|
||||
ldo->desc.bypass_mask = WM831X_LDO1_SWI;
|
||||
|
||||
config.dev = pdev->dev.parent;
|
||||
if (pdata)
|
||||
@@ -488,6 +492,8 @@ static struct regulator_ops wm831x_aldo_ops = {
|
||||
.get_mode = wm831x_aldo_get_mode,
|
||||
.set_mode = wm831x_aldo_set_mode,
|
||||
.get_status = wm831x_aldo_get_status,
|
||||
.set_bypass = regulator_set_bypass_regmap,
|
||||
.get_bypass = regulator_get_bypass_regmap,
|
||||
|
||||
.is_enabled = regulator_is_enabled_regmap,
|
||||
.enable = regulator_enable_regmap,
|
||||
@@ -544,6 +550,8 @@ static __devinit int wm831x_aldo_probe(struct platform_device *pdev)
|
||||
ldo->desc.vsel_mask = WM831X_LDO7_ON_VSEL_MASK;
|
||||
ldo->desc.enable_reg = WM831X_LDO_ENABLE;
|
||||
ldo->desc.enable_mask = 1 << id;
|
||||
ldo->desc.bypass_reg = ldo->base;
|
||||
ldo->desc.bypass_mask = WM831X_LDO7_SWI;
|
||||
|
||||
config.dev = pdev->dev.parent;
|
||||
if (pdata)
|
||||
|
||||
@@ -23,7 +23,8 @@ enum amic_type {
|
||||
/* Mic-biases */
|
||||
enum amic_micbias {
|
||||
AMIC_MICBIAS_VAMIC1,
|
||||
AMIC_MICBIAS_VAMIC2
|
||||
AMIC_MICBIAS_VAMIC2,
|
||||
AMIC_MICBIAS_UNKNOWN
|
||||
};
|
||||
|
||||
/* Bias-voltage */
|
||||
@@ -31,7 +32,8 @@ enum ear_cm_voltage {
|
||||
EAR_CMV_0_95V,
|
||||
EAR_CMV_1_10V,
|
||||
EAR_CMV_1_27V,
|
||||
EAR_CMV_1_58V
|
||||
EAR_CMV_1_58V,
|
||||
EAR_CMV_UNKNOWN
|
||||
};
|
||||
|
||||
/* Analog microphone settings */
|
||||
|
||||
@@ -177,6 +177,8 @@ int regulator_set_mode(struct regulator *regulator, unsigned int mode);
|
||||
unsigned int regulator_get_mode(struct regulator *regulator);
|
||||
int regulator_set_optimum_mode(struct regulator *regulator, int load_uA);
|
||||
|
||||
int regulator_allow_bypass(struct regulator *regulator, bool allow);
|
||||
|
||||
/* regulator notifier block */
|
||||
int regulator_register_notifier(struct regulator *regulator,
|
||||
struct notifier_block *nb);
|
||||
@@ -328,6 +330,12 @@ static inline int regulator_set_optimum_mode(struct regulator *regulator,
|
||||
return REGULATOR_MODE_NORMAL;
|
||||
}
|
||||
|
||||
static inline int regulator_allow_bypass(struct regulator *regulator,
|
||||
bool allow)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int regulator_register_notifier(struct regulator *regulator,
|
||||
struct notifier_block *nb)
|
||||
{
|
||||
|
||||
@@ -32,6 +32,8 @@ enum regulator_status {
|
||||
REGULATOR_STATUS_NORMAL,
|
||||
REGULATOR_STATUS_IDLE,
|
||||
REGULATOR_STATUS_STANDBY,
|
||||
/* The regulator is enabled but not regulating */
|
||||
REGULATOR_STATUS_BYPASS,
|
||||
/* in case that any other status doesn't apply */
|
||||
REGULATOR_STATUS_UNDEFINED,
|
||||
};
|
||||
@@ -67,6 +69,9 @@ enum regulator_status {
|
||||
* @get_optimum_mode: Get the most efficient operating mode for the regulator
|
||||
* when running with the specified parameters.
|
||||
*
|
||||
* @set_bypass: Set the regulator in bypass mode.
|
||||
* @get_bypass: Get the regulator bypass mode state.
|
||||
*
|
||||
* @enable_time: Time taken for the regulator voltage output voltage to
|
||||
* stabilise after being enabled, in microseconds.
|
||||
* @set_ramp_delay: Set the ramp delay for the regulator. The driver should
|
||||
@@ -133,6 +138,10 @@ struct regulator_ops {
|
||||
unsigned int (*get_optimum_mode) (struct regulator_dev *, int input_uV,
|
||||
int output_uV, int load_uA);
|
||||
|
||||
/* control and report on bypass mode */
|
||||
int (*set_bypass)(struct regulator_dev *dev, bool enable);
|
||||
int (*get_bypass)(struct regulator_dev *dev, bool *enable);
|
||||
|
||||
/* the operations below are for configuration of regulator state when
|
||||
* its parent PMIC enters a global STANDBY/HIBERNATE state */
|
||||
|
||||
@@ -205,6 +214,8 @@ struct regulator_desc {
|
||||
unsigned int vsel_mask;
|
||||
unsigned int enable_reg;
|
||||
unsigned int enable_mask;
|
||||
unsigned int bypass_reg;
|
||||
unsigned int bypass_mask;
|
||||
|
||||
unsigned int enable_time;
|
||||
};
|
||||
@@ -253,6 +264,7 @@ struct regulator_dev {
|
||||
int exclusive;
|
||||
u32 use_count;
|
||||
u32 open_count;
|
||||
u32 bypass_count;
|
||||
|
||||
/* lists we belong to */
|
||||
struct list_head list; /* list of all regulators */
|
||||
@@ -310,6 +322,8 @@ int regulator_disable_regmap(struct regulator_dev *rdev);
|
||||
int regulator_set_voltage_time_sel(struct regulator_dev *rdev,
|
||||
unsigned int old_selector,
|
||||
unsigned int new_selector);
|
||||
int regulator_set_bypass_regmap(struct regulator_dev *rdev, bool enable);
|
||||
int regulator_get_bypass_regmap(struct regulator_dev *rdev, bool *enable);
|
||||
|
||||
void *regulator_get_init_drvdata(struct regulator_init_data *reg_init_data);
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ struct regulator;
|
||||
* board/machine.
|
||||
* STATUS: Regulator can be enabled and disabled.
|
||||
* DRMS: Dynamic Regulator Mode Switching is enabled for this regulator.
|
||||
* BYPASS: Regulator can be put into bypass mode
|
||||
*/
|
||||
|
||||
#define REGULATOR_CHANGE_VOLTAGE 0x1
|
||||
@@ -39,6 +40,7 @@ struct regulator;
|
||||
#define REGULATOR_CHANGE_MODE 0x4
|
||||
#define REGULATOR_CHANGE_STATUS 0x8
|
||||
#define REGULATOR_CHANGE_DRMS 0x10
|
||||
#define REGULATOR_CHANGE_BYPASS 0x20
|
||||
|
||||
/**
|
||||
* struct regulator_state - regulator state during low power system states
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* DA9055 ALSA Soc codec driver
|
||||
*
|
||||
* Copyright (c) 2012 Dialog Semiconductor
|
||||
*
|
||||
* Tested on (Samsung SMDK6410 board + DA9055 EVB) using I2S and I2C
|
||||
* Written by David Chen <david.chen@diasemi.com> and
|
||||
* Ashish Chavan <ashish.chavan@kpitcummins.com>
|
||||
*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __SOUND_DA9055_H__
|
||||
#define __SOUND_DA9055_H__
|
||||
|
||||
enum da9055_micbias_voltage {
|
||||
DA9055_MICBIAS_1_6V = 0,
|
||||
DA9055_MICBIAS_1_8V = 1,
|
||||
DA9055_MICBIAS_2_1V = 2,
|
||||
DA9055_MICBIAS_2_2V = 3,
|
||||
};
|
||||
|
||||
struct da9055_platform_data {
|
||||
/* Selects which of the two MicBias pins acts as the bias source */
|
||||
bool micbias_source;
|
||||
/* Selects the micbias voltage */
|
||||
enum da9055_micbias_voltage micbias;
|
||||
};
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user