Skip to content

Commit 9d0af44

Browse files
committed
Merge branch 'for-linus' into for-next
Resolved the merge conflict in HD-audio Tegra driver. Signed-off-by: Takashi Iwai <[email protected]>
2 parents 5af2902 + 4d024fe commit 9d0af44

File tree

18 files changed

+280
-113
lines changed

18 files changed

+280
-113
lines changed

include/sound/hdaudio.h

Lines changed: 53 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
#include <linux/device.h>
1010
#include <linux/interrupt.h>
11+
#include <linux/io.h>
1112
#include <linux/pm_runtime.h>
1213
#include <linux/timecounter.h>
1314
#include <sound/core.h>
@@ -332,6 +333,7 @@ struct hdac_bus {
332333
bool chip_init:1; /* h/w initialized */
333334

334335
/* behavior flags */
336+
bool aligned_mmio:1; /* aligned MMIO access */
335337
bool sync_write:1; /* sync after verb write */
336338
bool use_posbuf:1; /* use position buffer */
337339
bool snoop:1; /* enable snooping */
@@ -408,34 +410,61 @@ void snd_hdac_bus_free_stream_pages(struct hdac_bus *bus);
408410
unsigned int snd_hdac_aligned_read(void __iomem *addr, unsigned int mask);
409411
void snd_hdac_aligned_write(unsigned int val, void __iomem *addr,
410412
unsigned int mask);
411-
#define snd_hdac_reg_writeb(v, addr) snd_hdac_aligned_write(v, addr, 0xff)
412-
#define snd_hdac_reg_writew(v, addr) snd_hdac_aligned_write(v, addr, 0xffff)
413-
#define snd_hdac_reg_readb(addr) snd_hdac_aligned_read(addr, 0xff)
414-
#define snd_hdac_reg_readw(addr) snd_hdac_aligned_read(addr, 0xffff)
415-
#else /* CONFIG_SND_HDA_ALIGNED_MMIO */
416-
#define snd_hdac_reg_writeb(val, addr) writeb(val, addr)
417-
#define snd_hdac_reg_writew(val, addr) writew(val, addr)
418-
#define snd_hdac_reg_readb(addr) readb(addr)
419-
#define snd_hdac_reg_readw(addr) readw(addr)
420-
#endif /* CONFIG_SND_HDA_ALIGNED_MMIO */
421-
#define snd_hdac_reg_writel(val, addr) writel(val, addr)
422-
#define snd_hdac_reg_readl(addr) readl(addr)
413+
#define snd_hdac_aligned_mmio(bus) (bus)->aligned_mmio
414+
#else
415+
#define snd_hdac_aligned_mmio(bus) false
416+
#define snd_hdac_aligned_read(addr, mask) 0
417+
#define snd_hdac_aligned_write(val, addr, mask) do {} while (0)
418+
#endif
419+
420+
static inline void snd_hdac_reg_writeb(struct hdac_bus *bus, void __iomem *addr,
421+
u8 val)
422+
{
423+
if (snd_hdac_aligned_mmio(bus))
424+
snd_hdac_aligned_write(val, addr, 0xff);
425+
else
426+
writeb(val, addr);
427+
}
428+
429+
static inline void snd_hdac_reg_writew(struct hdac_bus *bus, void __iomem *addr,
430+
u16 val)
431+
{
432+
if (snd_hdac_aligned_mmio(bus))
433+
snd_hdac_aligned_write(val, addr, 0xffff);
434+
else
435+
writew(val, addr);
436+
}
437+
438+
static inline u8 snd_hdac_reg_readb(struct hdac_bus *bus, void __iomem *addr)
439+
{
440+
return snd_hdac_aligned_mmio(bus) ?
441+
snd_hdac_aligned_read(addr, 0xff) : readb(addr);
442+
}
443+
444+
static inline u16 snd_hdac_reg_readw(struct hdac_bus *bus, void __iomem *addr)
445+
{
446+
return snd_hdac_aligned_mmio(bus) ?
447+
snd_hdac_aligned_read(addr, 0xffff) : readw(addr);
448+
}
449+
450+
#define snd_hdac_reg_writel(bus, addr, val) writel(val, addr)
451+
#define snd_hdac_reg_readl(bus, addr) readl(addr)
423452

424453
/*
425454
* macros for easy use
426455
*/
427456
#define _snd_hdac_chip_writeb(chip, reg, value) \
428-
snd_hdac_reg_writeb(value, (chip)->remap_addr + (reg))
457+
snd_hdac_reg_writeb(chip, (chip)->remap_addr + (reg), value)
429458
#define _snd_hdac_chip_readb(chip, reg) \
430-
snd_hdac_reg_readb((chip)->remap_addr + (reg))
459+
snd_hdac_reg_readb(chip, (chip)->remap_addr + (reg))
431460
#define _snd_hdac_chip_writew(chip, reg, value) \
432-
snd_hdac_reg_writew(value, (chip)->remap_addr + (reg))
461+
snd_hdac_reg_writew(chip, (chip)->remap_addr + (reg), value)
433462
#define _snd_hdac_chip_readw(chip, reg) \
434-
snd_hdac_reg_readw((chip)->remap_addr + (reg))
463+
snd_hdac_reg_readw(chip, (chip)->remap_addr + (reg))
435464
#define _snd_hdac_chip_writel(chip, reg, value) \
436-
snd_hdac_reg_writel(value, (chip)->remap_addr + (reg))
465+
snd_hdac_reg_writel(chip, (chip)->remap_addr + (reg), value)
437466
#define _snd_hdac_chip_readl(chip, reg) \
438-
snd_hdac_reg_readl((chip)->remap_addr + (reg))
467+
snd_hdac_reg_readl(chip, (chip)->remap_addr + (reg))
439468

440469
/* read/write a register, pass without AZX_REG_ prefix */
441470
#define snd_hdac_chip_writel(chip, reg, value) \
@@ -543,17 +572,17 @@ int snd_hdac_get_stream_stripe_ctl(struct hdac_bus *bus,
543572
*/
544573
/* read/write a register, pass without AZX_REG_ prefix */
545574
#define snd_hdac_stream_writel(dev, reg, value) \
546-
snd_hdac_reg_writel(value, (dev)->sd_addr + AZX_REG_ ## reg)
575+
snd_hdac_reg_writel((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
547576
#define snd_hdac_stream_writew(dev, reg, value) \
548-
snd_hdac_reg_writew(value, (dev)->sd_addr + AZX_REG_ ## reg)
577+
snd_hdac_reg_writew((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
549578
#define snd_hdac_stream_writeb(dev, reg, value) \
550-
snd_hdac_reg_writeb(value, (dev)->sd_addr + AZX_REG_ ## reg)
579+
snd_hdac_reg_writeb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg, value)
551580
#define snd_hdac_stream_readl(dev, reg) \
552-
snd_hdac_reg_readl((dev)->sd_addr + AZX_REG_ ## reg)
581+
snd_hdac_reg_readl((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
553582
#define snd_hdac_stream_readw(dev, reg) \
554-
snd_hdac_reg_readw((dev)->sd_addr + AZX_REG_ ## reg)
583+
snd_hdac_reg_readw((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
555584
#define snd_hdac_stream_readb(dev, reg) \
556-
snd_hdac_reg_readb((dev)->sd_addr + AZX_REG_ ## reg)
585+
snd_hdac_reg_readb((dev)->bus, (dev)->sd_addr + AZX_REG_ ## reg)
557586

558587
/* update a register, pass without AZX_REG_ prefix */
559588
#define snd_hdac_stream_updatel(dev, reg, mask, val) \

sound/core/seq/seq_timer.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -471,15 +471,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry,
471471
q = queueptr(idx);
472472
if (q == NULL)
473473
continue;
474-
if ((tmr = q->timer) == NULL ||
475-
(ti = tmr->timeri) == NULL) {
476-
queuefree(q);
477-
continue;
478-
}
474+
mutex_lock(&q->timer_mutex);
475+
tmr = q->timer;
476+
if (!tmr)
477+
goto unlock;
478+
ti = tmr->timeri;
479+
if (!ti)
480+
goto unlock;
479481
snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);
480482
resolution = snd_timer_resolution(ti) * tmr->ticks;
481483
snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);
482484
snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);
485+
unlock:
486+
mutex_unlock(&q->timer_mutex);
483487
queuefree(q);
484488
}
485489
}

sound/firewire/dice/dice-extension.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice)
159159
int j;
160160

161161
for (j = i + 1; j < 9; ++j) {
162-
if (pointers[i * 2] == pointers[j * 2])
162+
if (pointers[i * 2] == pointers[j * 2]) {
163+
// Fallback to limited functionality.
164+
err = -ENXIO;
163165
goto end;
166+
}
164167
}
165168
}
166169

sound/firewire/tascam/amdtp-tascam.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s,
157157
if ((before ^ after) & mask) {
158158
struct snd_firewire_tascam_change *entry =
159159
&tscm->queue[tscm->push_pos];
160+
unsigned long flag;
160161

161-
spin_lock_irq(&tscm->lock);
162+
spin_lock_irqsave(&tscm->lock, flag);
162163
entry->index = index;
163164
entry->before = before;
164165
entry->after = after;
165166
if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
166167
tscm->push_pos = 0;
167-
spin_unlock_irq(&tscm->lock);
168+
spin_unlock_irqrestore(&tscm->lock, flag);
168169

169170
wake_up(&tscm->hwdep_wait);
170171
}

sound/pci/hda/hda_tegra.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ static int hda_tegra_create(struct snd_card *card,
395395
return err;
396396

397397
chip->bus.core.needs_damn_long_delay = 1;
398+
chip->bus.core.aligned_mmio = 1;
398399

399400
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
400401
if (err < 0) {

sound/soc/codecs/cros_ec_codec.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
#include <crypto/hash.h>
1212
#include <crypto/sha.h>
13+
#include <linux/acpi.h>
1314
#include <linux/delay.h>
1415
#include <linux/device.h>
1516
#include <linux/io.h>
@@ -1047,10 +1048,17 @@ static const struct of_device_id cros_ec_codec_of_match[] = {
10471048
MODULE_DEVICE_TABLE(of, cros_ec_codec_of_match);
10481049
#endif
10491050

1051+
static const struct acpi_device_id cros_ec_codec_acpi_id[] = {
1052+
{ "GOOG0013", 0 },
1053+
{ }
1054+
};
1055+
MODULE_DEVICE_TABLE(acpi, cros_ec_codec_acpi_id);
1056+
10501057
static struct platform_driver cros_ec_codec_platform_driver = {
10511058
.driver = {
10521059
.name = "cros-ec-codec",
10531060
.of_match_table = of_match_ptr(cros_ec_codec_of_match),
1061+
.acpi_match_table = ACPI_PTR(cros_ec_codec_acpi_id),
10541062
},
10551063
.probe = cros_ec_codec_platform_probe,
10561064
};

sound/soc/codecs/hdac_hda.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,9 @@ static int hdac_hda_dev_remove(struct hdac_device *hdev)
588588
struct hdac_hda_priv *hda_pvt;
589589

590590
hda_pvt = dev_get_drvdata(&hdev->dev);
591-
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
591+
if (hda_pvt && hda_pvt->codec.registered)
592+
cancel_delayed_work_sync(&hda_pvt->codec.jackpoll_work);
593+
592594
return 0;
593595
}
594596

sound/soc/codecs/msm8916-wcd-analog.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -396,9 +396,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component
396396

397397
switch (event) {
398398
case SND_SOC_DAPM_PRE_PMU:
399-
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
400-
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
401-
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
402399
snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
403400
snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
404401
MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
@@ -448,6 +445,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct
448445
struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
449446
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
450447

448+
switch (event) {
449+
case SND_SOC_DAPM_PRE_PMU:
450+
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
451+
MICB_1_INT_TX1_INT_RBIAS_EN_MASK,
452+
MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE);
453+
break;
454+
}
455+
451456
return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
452457
wcd->micbias1_cap_mode);
453458
}
@@ -558,6 +563,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct
558563
struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
559564

560565
switch (event) {
566+
case SND_SOC_DAPM_PRE_PMU:
567+
snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
568+
MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
569+
MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
570+
break;
561571
case SND_SOC_DAPM_POST_PMU:
562572
pm8916_mbhc_configure_bias(wcd, true);
563573
break;
@@ -938,10 +948,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
938948

939949
SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
940950
pm8916_wcd_analog_enable_micbias_ext1,
941-
SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
951+
SND_SOC_DAPM_POST_PMU),
942952
SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
943953
pm8916_wcd_analog_enable_micbias_ext2,
944-
SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
954+
SND_SOC_DAPM_POST_PMU),
945955

946956
SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
947957
pm8916_wcd_analog_enable_adc,

sound/soc/codecs/msm8916-wcd-digital.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator(
586586
snd_soc_component_write(component, rx_gain_reg[w->shift],
587587
snd_soc_component_read32(component, rx_gain_reg[w->shift]));
588588
break;
589+
case SND_SOC_DAPM_POST_PMD:
590+
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
591+
1 << w->shift, 1 << w->shift);
592+
snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
593+
1 << w->shift, 0x0);
594+
break;
589595
}
590596
return 0;
591597
}

sound/soc/codecs/rt5640.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,6 +2432,13 @@ static void rt5640_disable_jack_detect(struct snd_soc_component *component)
24322432
{
24332433
struct rt5640_priv *rt5640 = snd_soc_component_get_drvdata(component);
24342434

2435+
/*
2436+
* soc_remove_component() force-disables jack and thus rt5640->jack
2437+
* could be NULL at the time of driver's module unloading.
2438+
*/
2439+
if (!rt5640->jack)
2440+
return;
2441+
24352442
disable_irq(rt5640->irq);
24362443
rt5640_cancel_work(rt5640);
24372444

0 commit comments

Comments
 (0)