Compare

3110d09bb98e3ac66482a7b257548a1683ec6c1a..b26edc925c1cfa0184cd270ed81d4833db045ce0

ASoC: pcm3168a: Fix the DAC zero flag polarity bit

The DAC Zero Flag Polarity enum uses PCM3168A_DAC_ATSPDA_SHIFT, which
is bit 6 of register 70. That bit is ATSPDA, the attenuation speed,
which the DAC Volume Rate Multiplier enum already owns. The datasheet
puts ZREV, the zero flag polarity, at bit 0. The header defines
PCM3168A_DAC_ZREV_SHIFT for it, but nothing uses it.

So changing the zero flag polarity changes the attenuation speed, and
ZREV cannot be set.

Use PCM3168A_DAC_ZREV_SHIFT.

Fixes: a9b17a638af5 ("ASoC: pcm3168a: Add driver for pcm3168a codec")
Link: https://www.ti.com/lit/ds/symlink/pcm3168a.pdf
Assisted-by: Claude:claude-opus-5-5
Signed-off-by: HyeongJun An <sammiee5311@gmail.com>
Reviewed-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20261008130953.2446692-4-sammiee5311@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>

HyeongJun An <sammiee5311@gmail.com> · 2026-10-08 13:09 UTC · committed by Mark Brown

Browse files
9 files changed, +18 −22
modified kernel/trace/Makefile
@@ -146,12 +146,11 @@ KASAN_SANITIZE_undefsyms_base.o := y
146 146
147 147 UNDEFINED_ALLOWLIST = __asan __gcov __kasan __kcsan __hwasan __sancov __sanitizer __tsan __ubsan __msan \
148 148 __aeabi_unwind_cpp __s390_indirect_jump __x86_indirect_thunk simple_ring_buffer \
149 - current_thread_info_reg \
150 - $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '$$2 {print $$2}')
149 + $(shell $(NM) -u $(obj)/undefsyms_base.o 2>/dev/null | awk '{print $$2}')
151 150
152 151 quiet_cmd_check_undefined = NM $<
153 152 cmd_check_undefined = \
154 - undefsyms=$$($(NM) -u $< | awk '$$2 {print $$2}' | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
153 + undefsyms=$$($(NM) -u $< | grep -v $(addprefix -e , $(UNDEFINED_ALLOWLIST)) || true); \
155 154 if [ -n "$$undefsyms" ]; then \
156 155 echo "Unexpected symbols in $<:" >&2; \
157 156 echo "$$undefsyms" >&2; \
modified kernel/trace/ring_buffer.c
@@ -2380,9 +2380,6 @@ int ring_buffer_meta_seq_init(struct file *file, struct trace_buffer *buffer, in
2380 2380 struct seq_file *m;
2381 2381 int ret;
2382 2382
2383 - if (!cpumask_test_cpu(cpu, buffer->cpumask))
2384 - return -ENODEV;
2385 -
2386 2383 ret = seq_open(file, &rb_meta_seq_ops);
2387 2384 if (ret)
2388 2385 return ret;
@@ -3630,8 +3627,10 @@ static void rb_inc_iter(struct ring_buffer_iter *iter)
3630 3627 /* Return the index into the sub-buffers for a given sub-buffer */
3631 3628 static int rb_meta_subbuf_idx(struct ring_buffer_cpu_meta *meta, void *subbuf)
3632 3629 {
3633 - void *subbuf_array = rb_subbufs_from_meta(meta);
3630 + void *subbuf_array;
3634 3631
3632 + subbuf_array = (void *)meta + sizeof(int) * meta->nr_subbufs;
3633 + subbuf_array = (void *)ALIGN((unsigned long)subbuf_array, meta->subbuf_size);
3635 3634 return (subbuf - subbuf_array) / meta->subbuf_size;
3636 3635 }
3637 3636
@@ -7998,8 +7997,12 @@ consume:
7998 7997 goto out;
7999 7998 }
8000 7999
8000 + /* Did the reader catch up with the writer? */
8001 + if (cpu_buffer->reader_page == cpu_buffer->commit_page)
8002 + goto out;
8003 +
8001 8004 reader = rb_get_reader_page(cpu_buffer);
8002 - if (!reader)
8005 + if (WARN_ON(!reader))
8003 8006 goto out;
8004 8007
8005 8008 /* Check if any events were dropped */
modified kernel/trace/trace.c
@@ -5881,7 +5881,7 @@ static int tracing_buffer_meta_open(struct inode *inode, struct file *filp)
5881 5881
5882 5882 ret = ring_buffer_meta_seq_init(filp, tr->array_buffer.buffer, cpu);
5883 5883 if (ret < 0)
5884 - trace_array_put(tr);
5884 + __trace_array_put(tr);
5885 5885 return ret;
5886 5886 }
5887 5887
modified kernel/trace/trace_events_hist.c
@@ -289,7 +289,7 @@ static u64 hist_field_log2(struct hist_field *hist_field,
289 289
290 290 u64 val = hist_fn_call(operand, elt, buffer, rbe, event);
291 291
292 - return order_base_2(val);
292 + return (u64) ilog2(roundup_pow_of_two(val));
293 293 }
294 294
295 295 static u64 hist_field_bucket(struct hist_field *hist_field,
@@ -3090,7 +3090,7 @@ create_field_var_hist(struct hist_trigger_data *target_hist_data,
3090 3090 key_field = hist_data->fields[i];
3091 3091 if (!first)
3092 3092 seq_buf_putc(&s, ',');
3093 - expr_field_str(key_field, &s);
3093 + seq_buf_puts(&s, key_field->field->name);
3094 3094 first = false;
3095 3095 }
3096 3096
modified kernel/trace/trace_snapshot.c
@@ -675,12 +675,9 @@ tracing_snapshot_write(struct file *filp, const char __user *ubuf, size_t cnt,
675 675 if (iter->cpu_file != RING_BUFFER_ALL_CPUS)
676 676 return -EINVAL;
677 677 #endif
678 - if (tr->allocated_snapshot) {
678 + if (tr->allocated_snapshot)
679 679 ret = resize_buffer_duplicate_size(&tr->snapshot_buffer,
680 680 &tr->array_buffer, iter->cpu_file);
681 - if (ret < 0)
682 - return ret;
683 - }
684 681
685 682 ret = tracing_arm_snapshot_locked(tr);
686 683 if (ret)
modified kernel/trace/undefsyms_base.c
@@ -9,7 +9,6 @@
9 9
10 10 #include <linux/atomic.h>
11 11 #include <linux/string.h>
12 - #include <asm/local.h>
13 12 #include <asm/page.h>
14 13
15 14 void undefsyms_base(void *p, int n);
@@ -19,13 +18,11 @@ static char page[PAGE_SIZE] __aligned(PAGE_SIZE);
19 18 void undefsyms_base(void *p, int n)
20 19 {
21 20 char buffer[256] = { 0 };
22 - u32 u = 0;
23 21
22 + u32 u = 0;
24 23 memset((char * volatile)page, 8, PAGE_SIZE);
25 24 memset((char * volatile)buffer, 8, sizeof(buffer));
26 25 memcpy((void * volatile)p, buffer, sizeof(buffer));
27 26 cmpxchg((u32 * volatile)&u, 0, 8);
28 - cmpxchg((unsigned long *)p, 0, 8);
29 - local_set((local_t *)p, 8);
30 27 WARN_ON(n == 0xdeadbeef);
31 28 }
modified sound/soc/codecs/cs42l52.c
@@ -290,7 +290,7 @@ static const char * const cs42l52_ng_type_text[] = {
290 290 };
291 291
292 292 static SOC_ENUM_SINGLE_DECL(ng_type_enum,
293 - CS42L52_NOISE_GATE_CTL, 6,
293 + CS42L52_NOISE_GATE_CTL, 7,
294 294 cs42l52_ng_type_text);
295 295
296 296 static const char * const left_swap_text[] = {
modified sound/soc/codecs/cs42l56.c
@@ -481,7 +481,7 @@ static const struct snd_kcontrol_new cs42l56_snd_controls[] = {
481 481 0, 0x3f, 0, 0),
482 482 SOC_SINGLE_TLV("Limiter MAX", CS42L56_LIM_THRESHOLD_CTL,
483 483 5, 0x07, 1, alc_tlv),
484 - SOC_SINGLE_TLV("Limiter Cushion", CS42L56_ALC_THRESHOLD,
484 + SOC_SINGLE_TLV("Limiter Cushion", CS42L56_LIM_THRESHOLD_CTL,
485 485 2, 0x07, 1, alc_tlv),
486 486
487 487 SOC_SINGLE("NG Switch", CS42L56_NOISE_GATE_CTL, 6, 1, 1),
modified sound/soc/codecs/pcm3168a.c
@@ -103,7 +103,7 @@ static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_func, PCM3168A_DAC_ATT_DEMP_ZF,
103 103 static const char *const pcm3168a_pol[] = { "Active High", "Active Low" };
104 104
105 105 static SOC_ENUM_SINGLE_DECL(pcm3168a_dac_zf_pol, PCM3168A_DAC_ATT_DEMP_ZF,
106 - PCM3168A_DAC_ATSPDA_SHIFT, pcm3168a_pol);
106 + PCM3168A_DAC_ZREV_SHIFT, pcm3168a_pol);
107 107
108 108 static const char *const pcm3168a_con[] = { "Differential", "Single-Ended" };
109 109