Commit 9d0af44c authored by Takashi Iwai's avatar Takashi Iwai

Merge branch 'for-linus' into for-next

Resolved the merge conflict in HD-audio Tegra driver.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parents 5af29028 4d024fe8
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include <linux/device.h> #include <linux/device.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/timecounter.h> #include <linux/timecounter.h>
#include <sound/core.h> #include <sound/core.h>
...@@ -332,6 +333,7 @@ struct hdac_bus { ...@@ -332,6 +333,7 @@ struct hdac_bus {
bool chip_init:1; /* h/w initialized */ bool chip_init:1; /* h/w initialized */
/* behavior flags */ /* behavior flags */
bool aligned_mmio:1; /* aligned MMIO access */
bool sync_write:1; /* sync after verb write */ bool sync_write:1; /* sync after verb write */
bool use_posbuf:1; /* use position buffer */ bool use_posbuf:1; /* use position buffer */
bool snoop:1; /* enable snooping */ bool snoop:1; /* enable snooping */
...@@ -408,34 +410,61 @@ void snd_hdac_bus_free_stream_pages(struct hdac_bus *bus); ...@@ -408,34 +410,61 @@ void snd_hdac_bus_free_stream_pages(struct hdac_bus *bus);
unsigned int snd_hdac_aligned_read(void __iomem *addr, unsigned int mask); unsigned int snd_hdac_aligned_read(void __iomem *addr, unsigned int mask);
void snd_hdac_aligned_write(unsigned int val, void __iomem *addr, void snd_hdac_aligned_write(unsigned int val, void __iomem *addr,
unsigned int mask); unsigned int mask);
#define snd_hdac_reg_writeb(v, addr) snd_hdac_aligned_write(v, addr, 0xff) #define snd_hdac_aligned_mmio(bus) (bus)->aligned_mmio
#define snd_hdac_reg_writew(v, addr) snd_hdac_aligned_write(v, addr, 0xffff) #else
#define snd_hdac_reg_readb(addr) snd_hdac_aligned_read(addr, 0xff) #define snd_hdac_aligned_mmio(bus) false
#define snd_hdac_reg_readw(addr) snd_hdac_aligned_read(addr, 0xffff) #define snd_hdac_aligned_read(addr, mask) 0
#else /* CONFIG_SND_HDA_ALIGNED_MMIO */ #define snd_hdac_aligned_write(val, addr, mask) do {} while (0)
#define snd_hdac_reg_writeb(val, addr) writeb(val, addr) #endif
#define snd_hdac_reg_writew(val, addr) writew(val, addr)
#define snd_hdac_reg_readb(addr) readb(addr) static inline void snd_hdac_reg_writeb(struct hdac_bus *bus, void __iomem *addr,
#define snd_hdac_reg_readw(addr) readw(addr) u8 val)
#endif /* CONFIG_SND_HDA_ALIGNED_MMIO */ {
#define snd_hdac_reg_writel(val, addr) writel(val, addr) if (snd_hdac_aligned_mmio(bus))
#define snd_hdac_reg_readl(addr) readl(addr) snd_hdac_aligned_write(val, addr, 0xff);
else
writeb(val, addr);
}
static inline void snd_hdac_reg_writew(struct hdac_bus *bus, void __iomem *addr,
u16 val)
{
if (snd_hdac_aligned_mmio(bus))
snd_hdac_aligned_write(val, addr, 0xffff);
else
writew(val, addr);
}
static inline u8 snd_hdac_reg_readb(struct hdac_bus *bus, void __iomem *addr)
{
return snd_hdac_aligned_mmio(bus) ?
snd_hdac_aligned_read(addr, 0xff) : readb(addr);
}
static inline u16 snd_hdac_reg_readw(struct hdac_bus *bus, void __iomem *addr)
{
return snd_hdac_aligned_mmio(bus) ?
snd_hdac_aligned_read(addr, 0xffff) : readw(addr);
}
#define snd_hdac_reg_writel(bus, addr, val) writel(val, addr)
#define snd_hdac_reg_readl(bus, addr) readl(addr)
/* /*
* macros for easy use * macros for easy use
*/ */
#define _snd_hdac_chip_writeb(chip, reg, value) \ #define _snd_hdac_chip_writeb(chip, reg, value) \
snd_hdac_reg_writeb(value, (chip)->remap_addr + (reg)) snd_hdac_reg_writeb(chip, (chip)->remap_addr + (reg), value)
#define _snd_hdac_chip_readb(chip, reg) \ #define _snd_hdac_chip_readb(chip, reg) \
snd_hdac_reg_readb((chip)->remap_addr + (reg)) snd_hdac_reg_readb(chip, (chip)->remap_addr + (reg))
#define _snd_hdac_chip_writew(chip, reg, value) \ #define _snd_hdac_chip_writew(chip, reg, value) \
snd_hdac_reg_writew(value, (chip)->remap_addr + (reg)) snd_hdac_reg_writew(chip, (chip)->remap_addr + (reg), value)
#define _snd_hdac_chip_readw(chip, reg) \ #define _snd_hdac_chip_readw(chip, reg) \
snd_hdac_reg_readw((chip)->remap_addr + (reg)) snd_hdac_reg_readw(chip, (chip)->remap_addr + (reg))
#define _snd_hdac_chip_writel(chip, reg, value) \ #define _snd_hdac_chip_writel(chip, reg, value) \
snd_hdac_reg_writel(value, (chip)->remap_addr + (reg)) snd_hdac_reg_writel(chip, (chip)->remap_addr + (reg), value)
#define _snd_hdac_chip_readl(chip, reg) \ #define _snd_hdac_chip_readl(chip, reg) \
snd_hdac_reg_readl((chip)->remap_addr + (reg)) snd_hdac_reg_readl(chip, (chip)->remap_addr + (reg))
/* read/write a register, pass without AZX_REG_ prefix */ /* read/write a register, pass without AZX_REG_ prefix */
#define snd_hdac_chip_writel(chip, reg, value) \ #define snd_hdac_chip_writel(chip, reg, value) \
...@@ -543,17 +572,17 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus, ...@@ -543,17 +572,17 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
*/ */
/* read/write a register, pass without AZX_REG_ prefix */ /* read/write a register, pass without AZX_REG_ prefix */
#define snd_hdac_stream_writel(dev, reg, value) \ #define snd_hdac_stream_writel(dev, reg, value) \
snd_hdac_reg_writel(value, (dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_writel((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
#define snd_hdac_stream_writew(dev, reg, value) \ #define snd_hdac_stream_writew(dev, reg, value) \
snd_hdac_reg_writew(value, (dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_writew((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
#define snd_hdac_stream_writeb(dev, reg, value) \ #define snd_hdac_stream_writeb(dev, reg, value) \
snd_hdac_reg_writeb(value, (dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_writeb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
#define snd_hdac_stream_readl(dev, reg) \ #define snd_hdac_stream_readl(dev, reg) \
snd_hdac_reg_readl((dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_readl((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
#define snd_hdac_stream_readw(dev, reg) \ #define snd_hdac_stream_readw(dev, reg) \
snd_hdac_reg_readw((dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
#define snd_hdac_stream_readb(dev, reg) \ #define snd_hdac_stream_readb(dev, reg) \
snd_hdac_reg_readb((dev)->sd_addr + AZX_REG_ ## reg) snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
/* update a register, pass without AZX_REG_ prefix */ /* update a register, pass without AZX_REG_ prefix */
#define snd_hdac_stream_updatel(dev, reg, mask, val) \ #define snd_hdac_stream_updatel(dev, reg, mask, val) \
......
...@@ -471,15 +471,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry, ...@@ -471,15 +471,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry,
q = queueptr(idx); q = queueptr(idx);
if (q == NULL) if (q == NULL)
continue; continue;
if ((tmr = q->timer) == NULL || mutex_lock(&q->timer_mutex);
(ti = tmr->timeri) == NULL) { tmr = q->timer;
queuefree(q); if (!tmr)
continue; goto unlock;
} ti = tmr->timeri;
if (!ti)
goto unlock;
snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name); snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);
resolution = snd_timer_resolution(ti) * tmr->ticks; resolution = snd_timer_resolution(ti) * tmr->ticks;
snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000); snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);
snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base); snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);
unlock:
mutex_unlock(&q->timer_mutex);
queuefree(q); queuefree(q);
} }
} }
......
...@@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice) ...@@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice)
int j; int j;
for (j = i + 1; j < 9; ++j) { for (j = i + 1; j < 9; ++j) {
if (pointers[i * 2] == pointers[j * 2]) if (pointers[i * 2] == pointers[j * 2]) {
// Fallback to limited functionality.
err = -ENXIO;
goto end; goto end;
}
} }
} }
......
...@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s, ...@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s,
if ((before ^ after) & mask) { if ((before ^ after) & mask) {
struct snd_firewire_tascam_change *entry = struct snd_firewire_tascam_change *entry =
&tscm->queue[tscm->push_pos]; &tscm->queue[tscm->push_pos];
unsigned long flag;
spin_lock_irq(&tscm->lock); spin_lock_irqsave(&tscm->lock, flag);
entry->index = index; entry->index = index;
entry->before = before; entry->before = before;
entry->after = after; entry->after = after;
if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT) if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
tscm->push_pos = 0; tscm->push_pos = 0;
spin_unlock_irq(&tscm->lock); spin_unlock_irqrestore(&tscm->lock, flag);
wake_up(&tscm->hwdep_wait); wake_up(&tscm->hwdep_wait);
} }
......
...@@ -395,6 +395,7 @@ static int hda_tegra_create(struct snd_card *card, ...@@ -395,6 +395,7 @@ static int hda_tegra_create(struct snd_card *card,
return err; return err;
chip->bus.core.needs_damn_long_delay = 1; chip->bus.core.needs_damn_long_delay = 1;
chip->bus.core.aligned_mmio = 1;
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
if (err < 0) { if (err < 0) {
......
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <crypto/hash.h> #include <crypto/hash.h>
#include <crypto/sha.h> #include <crypto/sha.h>
#include <linux/acpi.h>
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/device.h> #include <linux/device.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = { ...@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = {
MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match); MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
#endif #endif
static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
{ "GOOG0013", 0 },
{ }
};
MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
static struct platform_driver cros_ec_codec_platform_driver = { static struct platform_driver cros_ec_codec_platform_driver = {
.driver = { .driver = {
.name = "cros-ec-codec", .name = "cros-ec-codec",
.of_match_table = of_match_ptr(cros_ec_codec_of_match), .of_match_table = of_match_ptr(cros_ec_codec_of_match),
.acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id),
}, },
.probe = cros_ec_codec_platform_probe, .probe = cros_ec_codec_platform_probe,
}; };
......
...@@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev) ...@@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev)
struct hdac_hda_priv *hda_pvt; struct hdac_hda_priv *hda_pvt;
hda_pvt = dev_get_drvdata(&hdev->dev); hda_pvt = dev_get_drvdata(&hdev->dev);
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work); if (hda_pvt && hda_pvt->codec.registered)
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
return 0; return 0;
} }
......
...@@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component ...@@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component
switch (event) { switch (event) {
case SND_SOC_DAPM_PRE_PMU: case SND_SOC_DAPM_PRE_PMU:
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0); snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
snd_soc_component_update_bits(component, CDC_A_MICB_1_EN, snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
MICB_1_EN_OPA_STG2_TAIL_CURR_MASK, MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
...@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct ...@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
switch (event) {
case SND_SOC_DAPM_PRE_PMU:
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
MICB_1_INT_TX1_INT_RBIAS_EN_MASK,
MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE);
break;
}
return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg, return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
wcd->micbias1_cap_mode); wcd->micbias1_cap_mode);
} }
...@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct ...@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component); struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
switch (event) { switch (event) {
case SND_SOC_DAPM_PRE_PMU:
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
break;
case SND_SOC_DAPM_POST_PMU: case SND_SOC_DAPM_POST_PMU:
pm8916_mbhc_configure_bias(wcd, true); pm8916_mbhc_configure_bias(wcd, true);
break; break;
...@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = { ...@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
pm8916_wcd_analog_enable_micbias_ext1, pm8916_wcd_analog_enable_micbias_ext1,
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0, SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
pm8916_wcd_analog_enable_micbias_ext2, pm8916_wcd_analog_enable_micbias_ext2,
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD), SND_SOC_DAPM_POST_PMU),
SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0, SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
pm8916_wcd_analog_enable_adc, pm8916_wcd_analog_enable_adc,
......
...@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator( ...@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator(
snd_soc_component_write(component, rx_gain_reg[w->shift], snd_soc_component_write(component, rx_gain_reg[w->shift],
snd_soc_component_read32(component, rx_gain_reg[w->shift])); snd_soc_component_read32(component, rx_gain_reg[w->shift]));
break; break;
case SND_SOC_DAPM_POST_PMD:
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
1 << w->shift, 1 << w->shift);
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
1 << w->shift, 0x0);
break;
} }
return 0; return 0;
} }
......
...@@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component) ...@@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component)
{ {
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component); struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
/*
* soc_remove_component() force-disables jack and thus rt5640->jack
* could be NULL at the time of driver's module unloading.
*/
if (!rt5640->jack)
return;
disable_irq(rt5640->irq); disable_irq(rt5640->irq);
rt5640_cancel_work(rt5640); rt5640_cancel_work(rt5640);
......
...@@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = { ...@@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"), DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
DMI_MATCH(DMI_PRODUCT_NAME, "NB41"), DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),
}, },
.driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP .driver_data = (void *)(BYT_CHT_ES8316_SSP0
| BYT_CHT_ES8316_INTMIC_IN2_MAP
| BYT_CHT_ES8316_JD_INVERTED), | BYT_CHT_ES8316_JD_INVERTED),
}, },
{ /* Teclast X98 Plus II */ { /* Teclast X98 Plus II */
......
...@@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd) ...@@ -539,6 +539,9 @@ void snd_soc_pcm_component_free(struct snd_soc_pcm_runtime *rtd)
struct snd_soc_rtdcom_list *rtdcom; struct snd_soc_rtdcom_list *rtdcom;
struct snd_soc_component *component; struct snd_soc_component *component;
if (!rtd->pcm)
return;
for_each_rtd_components(rtd, rtdcom, component) for_each_rtd_components(rtd, rtdcom, component)
if (component->driver->pcm_destruct) if (component->driver->pcm_destruct)
component->driver->pcm_destruct(component, rtd->pcm); component->driver->pcm_destruct(component, rtd->pcm);
......
...@@ -24,19 +24,18 @@ ...@@ -24,19 +24,18 @@
#define IDISP_VID_INTEL 0x80860000 #define IDISP_VID_INTEL 0x80860000
/* load the legacy HDA codec driver */ /* load the legacy HDA codec driver */
#ifdef MODULE static int hda_codec_load_module(struct hda_codec *codec)
static void hda_codec_load_module(struct hda_codec *codec)
{ {
#ifdef MODULE
char alias[MODULE_NAME_LEN]; char alias[MODULE_NAME_LEN];
const char *module = alias; const char *module = alias;
snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias)); snd_hdac_codec_modalias(&codec->core, alias, sizeof(alias));
dev_dbg(&codec->core.dev, "loading codec module: %s\n", module); dev_dbg(&codec->core.dev, "loading codec module: %s\n", module);
request_module(module); request_module(module);
}
#else
static void hda_codec_load_module(struct hda_codec *codec) {}
#endif #endif
return device_attach(hda_codec_dev(codec));
}
/* enable controller wake up event for all codecs with jack connectors */ /* enable controller wake up event for all codecs with jack connectors */
void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev) void hda_codec_jack_wake_enable(struct snd_sof_dev *sdev)
...@@ -129,10 +128,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address) ...@@ -129,10 +128,16 @@ static int hda_codec_probe(struct snd_sof_dev *sdev, int address)
if ((mach_params && mach_params->common_hdmi_codec_drv) || if ((mach_params && mach_params->common_hdmi_codec_drv) ||
(resp & 0xFFFF0000) != IDISP_VID_INTEL) { (resp & 0xFFFF0000) != IDISP_VID_INTEL) {
hdev->type = HDA_DEV_LEGACY; hdev->type = HDA_DEV_LEGACY;
hda_codec_load_module(&hda_priv->codec); ret = hda_codec_load_module(&hda_priv->codec);
/*
* handle ret==0 (no driver bound) as an error, but pass
* other return codes without modification
*/
if (ret == 0)
ret = -ENOENT;
} }
return 0; return ret;
#else #else
hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL); hdev = devm_kzalloc(sdev->dev, sizeof(*hdev), GFP_KERNEL);
if (!hdev) if (!hdev)
......
...@@ -329,13 +329,13 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev) ...@@ -329,13 +329,13 @@ int hda_dsp_cl_boot_firmware(struct snd_sof_dev *sdev)
if (!ret) if (!ret)
break; break;
dev_err(sdev->dev, "error: Error code=0x%x: FW status=0x%x\n", dev_dbg(sdev->dev, "iteration %d of Core En/ROM load failed: %d\n",
i, ret);
dev_dbg(sdev->dev, "Error code=0x%x: FW status=0x%x\n",
snd_sof_dsp_read(sdev, HDA_DSP_BAR, snd_sof_dsp_read(sdev, HDA_DSP_BAR,
HDA_DSP_SRAM_REG_ROM_ERROR), HDA_DSP_SRAM_REG_ROM_ERROR),
snd_sof_dsp_read(sdev, HDA_DSP_BAR, snd_sof_dsp_read(sdev, HDA_DSP_BAR,
HDA_DSP_SRAM_REG_ROM_STATUS)); HDA_DSP_SRAM_REG_ROM_STATUS));
dev_err(sdev->dev, "error: iteration %d of Core En/ROM load failed: %d\n",
i, ret);
} }
if (i == HDA_FW_BOOT_ATTEMPTS) { if (i == HDA_FW_BOOT_ATTEMPTS) {
......
...@@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player, ...@@ -226,7 +226,6 @@ static void uni_player_set_channel_status(struct uniperif *player,
* sampling frequency. If no sample rate is already specified, then * sampling frequency. If no sample rate is already specified, then
* set one. * set one.
*/ */
mutex_lock(&player->ctrl_lock);
if (runtime) { if (runtime) {
switch (runtime->rate) { switch (runtime->rate) {
case 22050: case 22050:
...@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player, ...@@ -303,7 +302,6 @@ static void uni_player_set_channel_status(struct uniperif *player,
player->stream_settings.iec958.status[3 + (n * 4)] << 24; player->stream_settings.iec958.status[3 + (n * 4)] << 24;
SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status); SET_UNIPERIF_CHANNEL_STA_REGN(player, n, status);
} }
mutex_unlock(&player->ctrl_lock);
/* Update the channel status */ /* Update the channel status */
if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0) if (player->ver < SND_ST_UNIPERIF_VERSION_UNI_PLR_TOP_1_0)
...@@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player, ...@@ -365,8 +363,10 @@ static int uni_player_prepare_iec958(struct uniperif *player,
SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player); SET_UNIPERIF_CTRL_ZERO_STUFF_HW(player);
mutex_lock(&player->ctrl_lock);
/* Update the channel status */ /* Update the channel status */
uni_player_set_channel_status(player, runtime); uni_player_set_channel_status(player, runtime);
mutex_unlock(&player->ctrl_lock);
/* Clear the user validity user bits */ /* Clear the user validity user bits */
SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0); SET_UNIPERIF_USER_VALIDITY_VALIDITY_LR(player, 0);
...@@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, ...@@ -598,7 +598,6 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol,
iec958->status[1] = ucontrol->value.iec958.status[1]; iec958->status[1] = ucontrol->value.iec958.status[1];
iec958->status[2] = ucontrol->value.iec958.status[2]; iec958->status[2] = ucontrol->value.iec958.status[2];
iec958->status[3] = ucontrol->value.iec958.status[3]; iec958->status[3] = ucontrol->value.iec958.status[3];
mutex_unlock(&player->ctrl_lock);
spin_lock_irqsave(&player->irq_lock, flags); spin_lock_irqsave(&player->irq_lock, flags);
if (player->substream && player->substream->runtime) if (player->substream && player->substream->runtime)
...@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol, ...@@ -608,6 +607,8 @@ static int uni_player_ctl_iec958_put(struct snd_kcontrol *kcontrol,
uni_player_set_channel_status(player, NULL); uni_player_set_channel_status(player, NULL);
spin_unlock_irqrestore(&player->irq_lock, flags); spin_unlock_irqrestore(&player->irq_lock, flags);
mutex_unlock(&player->ctrl_lock);
return 0; return 0;
} }
......
...@@ -153,13 +153,13 @@ static const struct snd_soc_component_driver stm32_adfsdm_dai_component = { ...@@ -153,13 +153,13 @@ static const struct snd_soc_component_driver stm32_adfsdm_dai_component = {
.name = "stm32_dfsdm_audio", .name = "stm32_dfsdm_audio",
}; };
static void memcpy_32to16(void *dest, const void *src, size_t n) static void stm32_memcpy_32to16(void *dest, const void *src, size_t n)
{ {
unsigned int i = 0; unsigned int i = 0;
u16 *d = (u16 *)dest, *s = (u16 *)src; u16 *d = (u16 *)dest, *s = (u16 *)src;
s++; s++;
for (i = n; i > 0; i--) { for (i = n >> 1; i > 0; i--) {
*d++ = *s++; *d++ = *s++;
s++; s++;
} }
...@@ -186,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) ...@@ -186,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
if ((priv->pos + src_size) > buff_size) { if ((priv->pos + src_size) > buff_size) {
if (format == SNDRV_PCM_FORMAT_S16_LE) if (format == SNDRV_PCM_FORMAT_S16_LE)
memcpy_32to16(&pcm_buff[priv->pos], src_buff, stm32_memcpy_32to16(&pcm_buff[priv->pos], src_buff,
buff_size - priv->pos); buff_size - priv->pos);
else else
memcpy(&pcm_buff[priv->pos], src_buff, memcpy(&pcm_buff[priv->pos], src_buff,
buff_size - priv->pos); buff_size - priv->pos);
...@@ -196,8 +196,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private) ...@@ -196,8 +196,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
} }
if (format == SNDRV_PCM_FORMAT_S16_LE) if (format == SNDRV_PCM_FORMAT_S16_LE)
memcpy_32to16(&pcm_buff[priv->pos], stm32_memcpy_32to16(&pcm_buff[priv->pos],
&src_buff[src_size - cur_size], cur_size); &src_buff[src_size - cur_size], cur_size);
else else
memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size], memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size],
cur_size); cur_size);
......
This diff is collapsed.
...@@ -387,7 +387,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs, ...@@ -387,7 +387,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
add_sync_ep_from_ifnum: add_sync_ep_from_ifnum:
iface = usb_ifnum_to_if(dev, ifnum); iface = usb_ifnum_to_if(dev, ifnum);
if (!iface || iface->num_altsetting == 0) if (!iface || iface->num_altsetting < 2)
return -EINVAL; return -EINVAL;
alts = &iface->altsetting[1]; alts = &iface->altsetting[1];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment