Re: [PATCH v4 1/6] ASoC: tas2781: Add Header file for tas2781 driver

From: Christophe JAILLET
Date: Sun May 28 2023 - 03:27:51 EST


Le 28/05/2023 à 00:34, Shenghao Ding a écrit :
Create Header file for tas2781 driver.

Signed-off-by: Shenghao Ding <13916275206-7R9yAhoRP9E@xxxxxxxxxxxxxxxx>

---
Changes in v4:
- correct some enums have capitalized Chn, chn to all
Changes to be committed:
new file: include/sound/tas2781-dsp.h
new file: include/sound/tas2781-tlv.h
new file: include/sound/tas2781.h
---
include/sound/tas2781-dsp.h | 190 ++++++++++++++++++++++++++++++++++++
include/sound/tas2781-tlv.h | 22 +++++
include/sound/tas2781.h | 182 ++++++++++++++++++++++++++++++++++
3 files changed, 394 insertions(+)
create mode 100644 include/sound/tas2781-dsp.h
create mode 100644 include/sound/tas2781-tlv.h
create mode 100644 include/sound/tas2781.h

[...]

diff --git a/include/sound/tas2781-tlv.h b/include/sound/tas2781-tlv.h
new file mode 100644
index 000000000000..f4310dce655a
--- /dev/null
+++ b/include/sound/tas2781-tlv.h
@@ -0,0 +1,22 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+//
+// ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
+//
+// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
+// https://www.ti.com
+//
+// The TAS2781 driver implements a flexible and configurable
+// algo coefficient setting for one, two, or even multiple
+// TAS2781 chips.
+//
+// Author: Shenghao Ding <shenghao-ding-l0cyMroinI0@xxxxxxxxxxxxxxxx>
+// Author: Kevin Lu <kevin-lu-l0cyMroinI0@xxxxxxxxxxxxxxxx>
+//
+
+#ifndef __TAS2781_TLV_H__
+#define __TAS2781_TLV_H__
+
+static const DECLARE_TLV_DB_SCALE(dvc_tlv, -10000, 100, 0);
+static const DECLARE_TLV_DB_SCALE(amp_vol_tlv, 1100, 50, 0);
+
+#endif /* __TAS2781_LIB_H__ */

Nit: __TAS2781_TLV_H__ (or nothing as in the file above)

diff --git a/include/sound/tas2781.h b/include/sound/tas2781.h
new file mode 100644
index 000000000000..399bb8f9b54a
--- /dev/null
+++ b/include/sound/tas2781.h
@@ -0,0 +1,182 @@
+/* SPDX-License-Identifier: GPL-2.0 */
+//
+// ALSA SoC Texas Instruments TAS2781 Audio Smart Amplifier
+//
+// Copyright (C) 2022 - 2023 Texas Instruments Incorporated
+// https://www.ti.com
+//
+// The TAS2781 driver implements a flexible and configurable
+// algo coefficient setting for one, two, or even multiple
+// TAS2781 chips.
+//
+// Author: Shenghao Ding <shenghao-ding-l0cyMroinI0@xxxxxxxxxxxxxxxx>
+// Author: Kevin Lu <kevin-lu-l0cyMroinI0@xxxxxxxxxxxxxxxx>
+//
+
+#ifndef __TAS2781_H__
+#define __TAS2781_H__
+
+#include <linux/kernel.h>

I've not chekced in details, but is it really needed?

I've been told once, that we should try to avoid kernel.h in /include/


CJ