mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
ASoC: codecs: pm4125: Two minor fixes for
Merge series from Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>: I marked these as fixes, but the issue is not likely to trigger in normal conditions. Not tested on hardware, please kindly provide tested-by, the best with some probe bind/unbind cycle.
This commit is contained in:
@@ -71,7 +71,7 @@ struct pm4125_priv {
|
||||
struct wcd_mbhc_intr intr_ids;
|
||||
struct wcd_common common;
|
||||
struct irq_domain *virq;
|
||||
const struct regmap_irq_chip *pm4125_regmap_irq_chip;
|
||||
const struct regmap_irq_chip *chip_desc;
|
||||
struct regmap_irq_chip_data *irq_chip;
|
||||
struct snd_soc_jack *jack;
|
||||
unsigned long status_mask;
|
||||
@@ -177,7 +177,7 @@ static const u32 pm4125_config_regs[] = {
|
||||
PM4125_DIG_SWR_INTR_LEVEL_0,
|
||||
};
|
||||
|
||||
static struct regmap_irq_chip pm4125_regmap_irq_chip = {
|
||||
static const struct regmap_irq_chip pm4125_regmap_irq_chip = {
|
||||
.name = "pm4125",
|
||||
.irqs = pm4125_irqs,
|
||||
.num_irqs = ARRAY_SIZE(pm4125_irqs),
|
||||
@@ -1301,10 +1301,8 @@ static int pm4125_irq_init(struct pm4125_priv *pm4125, struct device *dev)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
pm4125_regmap_irq_chip.irq_drv_data = pm4125;
|
||||
|
||||
return devm_regmap_add_irq_chip(dev, pm4125->regmap, irq_create_mapping(pm4125->virq, 0),
|
||||
IRQF_ONESHOT, 0, &pm4125_regmap_irq_chip,
|
||||
IRQF_ONESHOT, 0, pm4125->chip_desc,
|
||||
&pm4125->irq_chip);
|
||||
}
|
||||
|
||||
@@ -1612,6 +1610,8 @@ static void pm4125_unbind(struct device *dev)
|
||||
struct pm4125_priv *pm4125 = dev_get_drvdata(dev);
|
||||
|
||||
snd_soc_unregister_component(dev);
|
||||
devm_regmap_del_irq_chip(dev, irq_find_mapping(pm4125->virq, 0),
|
||||
pm4125->irq_chip);
|
||||
device_link_remove(dev, pm4125->txdev);
|
||||
device_link_remove(dev, pm4125->rxdev);
|
||||
device_link_remove(pm4125->rxdev, pm4125->txdev);
|
||||
@@ -1647,6 +1647,7 @@ static int pm4125_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct component_match *match = NULL;
|
||||
struct device *dev = &pdev->dev;
|
||||
struct regmap_irq_chip *chip_desc;
|
||||
struct pm4125_priv *pm4125;
|
||||
struct wcd_mbhc_config *cfg;
|
||||
int ret;
|
||||
@@ -1657,6 +1658,14 @@ static int pm4125_probe(struct platform_device *pdev)
|
||||
|
||||
dev_set_drvdata(dev, pm4125);
|
||||
|
||||
chip_desc = devm_kmemdup(dev, &pm4125_regmap_irq_chip,
|
||||
sizeof(pm4125_regmap_irq_chip),
|
||||
GFP_KERNEL);
|
||||
if (!chip_desc)
|
||||
return -ENOMEM;
|
||||
chip_desc->irq_drv_data = pm4125;
|
||||
pm4125->chip_desc = chip_desc;
|
||||
|
||||
ret = devm_regulator_bulk_get_enable(dev, ARRAY_SIZE(pm4125_power_supplies),
|
||||
pm4125_power_supplies);
|
||||
if (ret)
|
||||
|
||||
Reference in New Issue
Block a user