Skip to content

Commit a9f73b0

Browse files
committed
Merge branch 'for-linus' into for-next
2 parents 0707541 + 5948342 commit a9f73b0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+363
-165
lines changed

Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ title: Audio codec controlled by ChromeOS EC
88

99
maintainers:
1010
- Cheng-Yi Chiang <[email protected]>
11+
- Tzung-Bi Shih <[email protected]>
1112

1213
description: |
1314
Google's ChromeOS EC codec is a digital mic codec provided by the

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4543,6 +4543,7 @@ F: drivers/platform/chrome/
45434543

45444544
CHROMEOS EC CODEC DRIVER
45454545
M: Cheng-Yi Chiang <[email protected]>
4546+
M: Tzung-Bi Shih <[email protected]>
45464547
R: Guenter Roeck <[email protected]>
45474548
S: Maintained
45484549
F: Documentation/devicetree/bindings/sound/google,cros-ec-codec.yaml

drivers/input/touchscreen/wm97xx-core.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -615,10 +615,9 @@ static int wm97xx_register_touch(struct wm97xx *wm)
615615
* extensions)
616616
*/
617617
wm->touch_dev = platform_device_alloc("wm97xx-touch", -1);
618-
if (!wm->touch_dev) {
619-
ret = -ENOMEM;
620-
goto touch_err;
621-
}
618+
if (!wm->touch_dev)
619+
return -ENOMEM;
620+
622621
platform_set_drvdata(wm->touch_dev, wm);
623622
wm->touch_dev->dev.parent = wm->dev;
624623
wm->touch_dev->dev.platform_data = pdata;
@@ -629,18 +628,13 @@ static int wm97xx_register_touch(struct wm97xx *wm)
629628
return 0;
630629
touch_reg_err:
631630
platform_device_put(wm->touch_dev);
632-
touch_err:
633-
input_unregister_device(wm->input_dev);
634-
wm->input_dev = NULL;
635631

636632
return ret;
637633
}
638634

639635
static void wm97xx_unregister_touch(struct wm97xx *wm)
640636
{
641637
platform_device_unregister(wm->touch_dev);
642-
input_unregister_device(wm->input_dev);
643-
wm->input_dev = NULL;
644638
}
645639

646640
static int _wm97xx_probe(struct wm97xx *wm)

drivers/soc/mediatek/mtk-scpsys.c

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -411,17 +411,12 @@ static int scpsys_power_off(struct generic_pm_domain *genpd)
411411
return ret;
412412
}
413413

414-
static int init_clks(struct platform_device *pdev, struct clk **clk)
414+
static void init_clks(struct platform_device *pdev, struct clk **clk)
415415
{
416416
int i;
417417

418-
for (i = CLK_NONE + 1; i < CLK_MAX; i++) {
418+
for (i = CLK_NONE + 1; i < CLK_MAX; i++)
419419
clk[i] = devm_clk_get(&pdev->dev, clk_names[i]);
420-
if (IS_ERR(clk[i]))
421-
return PTR_ERR(clk[i]);
422-
}
423-
424-
return 0;
425420
}
426421

427422
static struct scp *init_scp(struct platform_device *pdev,
@@ -431,7 +426,7 @@ static struct scp *init_scp(struct platform_device *pdev,
431426
{
432427
struct genpd_onecell_data *pd_data;
433428
struct resource *res;
434-
int i, j, ret;
429+
int i, j;
435430
struct scp *scp;
436431
struct clk *clk[CLK_MAX];
437432

@@ -486,9 +481,7 @@ static struct scp *init_scp(struct platform_device *pdev,
486481

487482
pd_data->num_domains = num;
488483

489-
ret = init_clks(pdev, clk);
490-
if (ret)
491-
return ERR_PTR(ret);
484+
init_clks(pdev, clk);
492485

493486
for (i = 0; i < num; i++) {
494487
struct scp_domain *scpd = &scp->domains[i];

include/sound/pcm.h

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -617,6 +617,7 @@ void snd_pcm_stream_unlock(struct snd_pcm_substream *substream);
617617
void snd_pcm_stream_lock_irq(struct snd_pcm_substream *substream);
618618
void snd_pcm_stream_unlock_irq(struct snd_pcm_substream *substream);
619619
unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
620+
unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream);
620621

621622
/**
622623
* snd_pcm_stream_lock_irqsave - Lock the PCM stream
@@ -635,6 +636,20 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream);
635636
void snd_pcm_stream_unlock_irqrestore(struct snd_pcm_substream *substream,
636637
unsigned long flags);
637638

639+
/**
640+
* snd_pcm_stream_lock_irqsave_nested - Single-nested PCM stream locking
641+
* @substream: PCM substream
642+
* @flags: irq flags
643+
*
644+
* This locks the PCM stream like snd_pcm_stream_lock_irqsave() but with
645+
* the single-depth lockdep subclass.
646+
*/
647+
#define snd_pcm_stream_lock_irqsave_nested(substream, flags) \
648+
do { \
649+
typecheck(unsigned long, flags); \
650+
flags = _snd_pcm_stream_lock_irqsave_nested(substream); \
651+
} while (0)
652+
638653
/**
639654
* snd_pcm_group_for_each_entry - iterate over the linked substreams
640655
* @s: the iterator

include/uapi/sound/asound.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,10 @@
5656
* *
5757
****************************************************************************/
5858

59+
#define AES_IEC958_STATUS_SIZE 24
60+
5961
struct snd_aes_iec958 {
60-
unsigned char status[24]; /* AES/IEC958 channel status bits */
62+
unsigned char status[AES_IEC958_STATUS_SIZE]; /* AES/IEC958 channel status bits */
6163
unsigned char subcode[147]; /* AES/IEC958 subcode bits */
6264
unsigned char pad; /* nothing */
6365
unsigned char dig_subframe[4]; /* AES/IEC958 subframe bits */

sound/core/memalloc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,8 @@ static void *snd_dma_noncontig_alloc(struct snd_dma_buffer *dmab, size_t size)
511511
DEFAULT_GFP, 0);
512512
if (!sgt)
513513
return NULL;
514-
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir);
514+
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev,
515+
sg_dma_address(sgt->sgl));
515516
p = dma_vmap_noncontiguous(dmab->dev.dev, size, sgt);
516517
if (p)
517518
dmab->private_data = sgt;
@@ -540,9 +541,9 @@ static void snd_dma_noncontig_sync(struct snd_dma_buffer *dmab,
540541
if (mode == SNDRV_DMA_SYNC_CPU) {
541542
if (dmab->dev.dir == DMA_TO_DEVICE)
542543
return;
544+
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
543545
dma_sync_sgtable_for_cpu(dmab->dev.dev, dmab->private_data,
544546
dmab->dev.dir);
545-
invalidate_kernel_vmap_range(dmab->area, dmab->bytes);
546547
} else {
547548
if (dmab->dev.dir == DMA_FROM_DEVICE)
548549
return;
@@ -671,9 +672,13 @@ static const struct snd_malloc_ops snd_dma_sg_wc_ops = {
671672
*/
672673
static void *snd_dma_noncoherent_alloc(struct snd_dma_buffer *dmab, size_t size)
673674
{
674-
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->dev.dir);
675-
return dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
676-
dmab->dev.dir, DEFAULT_GFP);
675+
void *p;
676+
677+
p = dma_alloc_noncoherent(dmab->dev.dev, size, &dmab->addr,
678+
dmab->dev.dir, DEFAULT_GFP);
679+
if (p)
680+
dmab->dev.need_sync = dma_need_sync(dmab->dev.dev, dmab->addr);
681+
return p;
677682
}
678683

679684
static void snd_dma_noncoherent_free(struct snd_dma_buffer *dmab)

sound/core/pcm_native.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,19 @@ unsigned long _snd_pcm_stream_lock_irqsave(struct snd_pcm_substream *substream)
172172
}
173173
EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave);
174174

175+
unsigned long _snd_pcm_stream_lock_irqsave_nested(struct snd_pcm_substream *substream)
176+
{
177+
unsigned long flags = 0;
178+
if (substream->pcm->nonatomic)
179+
mutex_lock_nested(&substream->self_group.mutex,
180+
SINGLE_DEPTH_NESTING);
181+
else
182+
spin_lock_irqsave_nested(&substream->self_group.lock, flags,
183+
SINGLE_DEPTH_NESTING);
184+
return flags;
185+
}
186+
EXPORT_SYMBOL_GPL(_snd_pcm_stream_lock_irqsave_nested);
187+
175188
/**
176189
* snd_pcm_stream_unlock_irqrestore - Unlock the PCM stream
177190
* @substream: PCM substream

sound/hda/intel-sdw-acpi.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ static bool is_link_enabled(struct fwnode_handle *fw_node, int i)
5050
static int
5151
sdw_intel_scan_controller(struct sdw_intel_acpi_info *info)
5252
{
53-
struct acpi_device *adev;
53+
struct acpi_device *adev = acpi_fetch_acpi_dev(info->handle);
5454
int ret, i;
5555
u8 count;
5656

57-
if (acpi_bus_get_device(info->handle, &adev))
57+
if (!adev)
5858
return -EINVAL;
5959

6060
/* Found controller, find links supported */
@@ -119,15 +119,14 @@ static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level,
119119
void *cdata, void **return_value)
120120
{
121121
struct sdw_intel_acpi_info *info = cdata;
122-
struct acpi_device *adev;
123122
acpi_status status;
124123
u64 adr;
125124

126125
status = acpi_evaluate_integer(handle, METHOD_NAME__ADR, NULL, &adr);
127126
if (ACPI_FAILURE(status))
128127
return AE_OK; /* keep going */
129128

130-
if (acpi_bus_get_device(handle, &adev)) {
129+
if (!acpi_fetch_acpi_dev(handle)) {
131130
pr_err("%s: Couldn't find ACPI handle\n", __func__);
132131
return AE_NOT_FOUND;
133132
}

sound/pci/hda/hda_auto_parser.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -981,7 +981,7 @@ void snd_hda_pick_fixup(struct hda_codec *codec,
981981
int id = HDA_FIXUP_ID_NOT_SET;
982982
const char *name = NULL;
983983
const char *type = NULL;
984-
int vendor, device;
984+
unsigned int vendor, device;
985985

986986
if (codec->fixup_id != HDA_FIXUP_ID_NOT_SET)
987987
return;

sound/pci/hda/hda_codec.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3000,6 +3000,10 @@ void snd_hda_codec_shutdown(struct hda_codec *codec)
30003000
{
30013001
struct hda_pcm *cpcm;
30023002

3003+
/* Skip the shutdown if codec is not registered */
3004+
if (!codec->registered)
3005+
return;
3006+
30033007
list_for_each_entry(cpcm, &codec->pcm_list_head, list)
30043008
snd_pcm_suspend_all(cpcm->pcm);
30053009

sound/pci/hda/hda_generic.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ static void snd_hda_gen_spec_free(struct hda_gen_spec *spec)
9191
free_kctls(spec);
9292
snd_array_free(&spec->paths);
9393
snd_array_free(&spec->loopback_list);
94+
#ifdef CONFIG_SND_HDA_GENERIC_LEDS
95+
if (spec->led_cdevs[LED_AUDIO_MUTE])
96+
led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MUTE]);
97+
if (spec->led_cdevs[LED_AUDIO_MICMUTE])
98+
led_classdev_unregister(spec->led_cdevs[LED_AUDIO_MICMUTE]);
99+
#endif
94100
}
95101

96102
/*
@@ -3922,7 +3928,10 @@ static int create_mute_led_cdev(struct hda_codec *codec,
39223928
enum led_brightness),
39233929
bool micmute)
39243930
{
3931+
struct hda_gen_spec *spec = codec->spec;
39253932
struct led_classdev *cdev;
3933+
int idx = micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE;
3934+
int err;
39263935

39273936
cdev = devm_kzalloc(&codec->core.dev, sizeof(*cdev), GFP_KERNEL);
39283937
if (!cdev)
@@ -3932,10 +3941,14 @@ static int create_mute_led_cdev(struct hda_codec *codec,
39323941
cdev->max_brightness = 1;
39333942
cdev->default_trigger = micmute ? "audio-micmute" : "audio-mute";
39343943
cdev->brightness_set_blocking = callback;
3935-
cdev->brightness = ledtrig_audio_get(micmute ? LED_AUDIO_MICMUTE : LED_AUDIO_MUTE);
3944+
cdev->brightness = ledtrig_audio_get(idx);
39363945
cdev->flags = LED_CORE_SUSPENDRESUME;
39373946

3938-
return devm_led_classdev_register(&codec->core.dev, cdev);
3947+
err = led_classdev_register(&codec->core.dev, cdev);
3948+
if (err < 0)
3949+
return err;
3950+
spec->led_cdevs[idx] = cdev;
3951+
return 0;
39393952
}
39403953

39413954
/**

sound/pci/hda/hda_generic.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ struct hda_gen_spec {
294294
struct hda_jack_callback *cb);
295295
void (*mic_autoswitch_hook)(struct hda_codec *codec,
296296
struct hda_jack_callback *cb);
297+
298+
/* leds */
299+
struct led_classdev *led_cdevs[NUM_AUDIO_LEDS];
297300
};
298301

299302
/* values for add_stereo_mix_input flag */

sound/pci/hda/hda_intel.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1615,6 +1615,7 @@ static const struct snd_pci_quirk probe_mask_list[] = {
16151615
/* forced codec slots */
16161616
SND_PCI_QUIRK(0x1043, 0x1262, "ASUS W5Fm", 0x103),
16171617
SND_PCI_QUIRK(0x1046, 0x1262, "ASUS W5F", 0x103),
1618+
SND_PCI_QUIRK(0x1558, 0x0351, "Schenker Dock 15", 0x105),
16181619
/* WinFast VP200 H (Teradici) user reported broken communication */
16191620
SND_PCI_QUIRK(0x3a21, 0x040d, "WinFast VP200 H", 0x101),
16201621
{}
@@ -1798,8 +1799,6 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
17981799

17991800
assign_position_fix(chip, check_position_fix(chip, position_fix[dev]));
18001801

1801-
check_probe_mask(chip, dev);
1802-
18031802
if (single_cmd < 0) /* allow fallback to single_cmd at errors */
18041803
chip->fallback_to_single_cmd = 1;
18051804
else /* explicitly set to single_cmd or not */
@@ -1825,6 +1824,8 @@ static int azx_create(struct snd_card *card, struct pci_dev *pci,
18251824
chip->bus.core.needs_damn_long_delay = 1;
18261825
}
18271826

1827+
check_probe_mask(chip, dev);
1828+
18281829
err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops);
18291830
if (err < 0) {
18301831
dev_err(card->dev, "Error creating device [card]!\n");

0 commit comments

Comments
 (0)