forked from luck/tmp_suning_uos_patched
b24413180f
Many source files in the tree are missing licensing information, which makes it harder for compliance tools to determine the correct license. By default all files without license information are under the default license of the kernel, which is GPL version 2. Update the files which contain no license information with the 'GPL-2.0' SPDX license identifier. The SPDX identifier is a legally binding shorthand, which can be used instead of the full boiler plate text. This patch is based on work done by Thomas Gleixner and Kate Stewart and Philippe Ombredanne. How this work was done: Patches were generated and checked against linux-4.14-rc6 for a subset of the use cases: - file had no licensing information it it. - file was a */uapi/* one with no licensing information in it, - file was a */uapi/* one with existing licensing information, Further patches will be generated in subsequent months to fix up cases where non-standard license headers were used, and references to license had to be inferred by heuristics based on keywords. The analysis to determine which SPDX License Identifier to be applied to a file was done in a spreadsheet of side by side results from of the output of two independent scanners (ScanCode & Windriver) producing SPDX tag:value files created by Philippe Ombredanne. Philippe prepared the base worksheet, and did an initial spot review of a few 1000 files. The 4.13 kernel was the starting point of the analysis with 60,537 files assessed. Kate Stewart did a file by file comparison of the scanner results in the spreadsheet to determine which SPDX license identifier(s) to be applied to the file. She confirmed any determination that was not immediately clear with lawyers working with the Linux Foundation. Criteria used to select files for SPDX license identifier tagging was: - Files considered eligible had to be source code files. - Make and config files were included as candidates if they contained >5 lines of source - File already had some variant of a license header in it (even if <5 lines). All documentation files were explicitly excluded. The following heuristics were used to determine which SPDX license identifiers to apply. - when both scanners couldn't find any license traces, file was considered to have no license information in it, and the top level COPYING file license applied. For non */uapi/* files that summary was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 11139 and resulted in the first patch in this series. If that file was a */uapi/* path one, it was "GPL-2.0 WITH Linux-syscall-note" otherwise it was "GPL-2.0". Results of that was: SPDX license identifier # files ---------------------------------------------------|------- GPL-2.0 WITH Linux-syscall-note 930 and resulted in the second patch in this series. - if a file had some form of licensing information in it, and was one of the */uapi/* ones, it was denoted with the Linux-syscall-note if any GPL family license was found in the file or had no licensing in it (per prior point). Results summary: SPDX license identifier # files ---------------------------------------------------|------ GPL-2.0 WITH Linux-syscall-note 270 GPL-2.0+ WITH Linux-syscall-note 169 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause) 21 ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) 17 LGPL-2.1+ WITH Linux-syscall-note 15 GPL-1.0+ WITH Linux-syscall-note 14 ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause) 5 LGPL-2.0+ WITH Linux-syscall-note 4 LGPL-2.1 WITH Linux-syscall-note 3 ((GPL-2.0 WITH Linux-syscall-note) OR MIT) 3 ((GPL-2.0 WITH Linux-syscall-note) AND MIT) 1 and that resulted in the third patch in this series. - when the two scanners agreed on the detected license(s), that became the concluded license(s). - when there was disagreement between the two scanners (one detected a license but the other didn't, or they both detected different licenses) a manual inspection of the file occurred. - In most cases a manual inspection of the information in the file resulted in a clear resolution of the license that should apply (and which scanner probably needed to revisit its heuristics). - When it was not immediately clear, the license identifier was confirmed with lawyers working with the Linux Foundation. - If there was any question as to the appropriate license identifier, the file was flagged for further research and to be revisited later in time. In total, over 70 hours of logged manual review was done on the spreadsheet to determine the SPDX license identifiers to apply to the source files by Kate, Philippe, Thomas and, in some cases, confirmation by lawyers working with the Linux Foundation. Kate also obtained a third independent scan of the 4.13 code base from FOSSology, and compared selected files where the other two scanners disagreed against that SPDX file, to see if there was new insights. The Windriver scanner is based on an older version of FOSSology in part, so they are related. Thomas did random spot checks in about 500 files from the spreadsheets for the uapi headers and agreed with SPDX license identifier in the files he inspected. For the non-uapi files Thomas did random spot checks in about 15000 files. In initial set of patches against 4.14-rc6, 3 files were found to have copy/paste license identifier errors, and have been fixed to reflect the correct identifier. Additionally Philippe spent 10 hours this week doing a detailed manual inspection and review of the 12,461 patched files from the initial patch version early this week with: - a full scancode scan run, collecting the matched texts, detected license ids and scores - reviewing anything where there was a license detected (about 500+ files) to ensure that the applied SPDX license was correct - reviewing anything where there was no detection but the patch license was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied SPDX license was correct This produced a worksheet with 20 files needing minor correction. This worksheet was then exported into 3 different .csv files for the different types of files to be modified. These .csv files were then reviewed by Greg. Thomas wrote a script to parse the csv files and add the proper SPDX tag to the file, in the format that the file expected. This script was further refined by Greg based on the output to detect more types of files automatically and to distinguish between header and source .c files (which need different comment types.) Finally Greg ran the script using the .csv files to generate the patches. Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Philippe Ombredanne <pombredanne@nexb.com> Reviewed-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
291 lines
9.4 KiB
C
291 lines
9.4 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
/*
|
|
* es8328.h -- ES8328 ALSA SoC Audio driver
|
|
*/
|
|
|
|
#ifndef _ES8328_H
|
|
#define _ES8328_H
|
|
|
|
#include <linux/regmap.h>
|
|
|
|
struct device;
|
|
|
|
extern const struct regmap_config es8328_regmap_config;
|
|
int es8328_probe(struct device *dev, struct regmap *regmap);
|
|
|
|
#define ES8328_DACLVOL 46
|
|
#define ES8328_DACRVOL 47
|
|
#define ES8328_DACCTL 28
|
|
#define ES8328_RATEMASK (0x1f << 0)
|
|
|
|
#define ES8328_CONTROL1 0x00
|
|
#define ES8328_CONTROL1_VMIDSEL_OFF (0 << 0)
|
|
#define ES8328_CONTROL1_VMIDSEL_50k (1 << 0)
|
|
#define ES8328_CONTROL1_VMIDSEL_500k (2 << 0)
|
|
#define ES8328_CONTROL1_VMIDSEL_5k (3 << 0)
|
|
#define ES8328_CONTROL1_VMIDSEL_MASK (3 << 0)
|
|
#define ES8328_CONTROL1_ENREF (1 << 2)
|
|
#define ES8328_CONTROL1_SEQEN (1 << 3)
|
|
#define ES8328_CONTROL1_SAMEFS (1 << 4)
|
|
#define ES8328_CONTROL1_DACMCLK_ADC (0 << 5)
|
|
#define ES8328_CONTROL1_DACMCLK_DAC (1 << 5)
|
|
#define ES8328_CONTROL1_LRCM (1 << 6)
|
|
#define ES8328_CONTROL1_SCP_RESET (1 << 7)
|
|
|
|
#define ES8328_CONTROL2 0x01
|
|
#define ES8328_CONTROL2_VREF_BUF_OFF (1 << 0)
|
|
#define ES8328_CONTROL2_VREF_LOWPOWER (1 << 1)
|
|
#define ES8328_CONTROL2_IBIASGEN_OFF (1 << 2)
|
|
#define ES8328_CONTROL2_ANALOG_OFF (1 << 3)
|
|
#define ES8328_CONTROL2_VREF_BUF_LOWPOWER (1 << 4)
|
|
#define ES8328_CONTROL2_VCM_MOD_LOWPOWER (1 << 5)
|
|
#define ES8328_CONTROL2_OVERCURRENT_ON (1 << 6)
|
|
#define ES8328_CONTROL2_THERMAL_SHUTDOWN_ON (1 << 7)
|
|
|
|
#define ES8328_CHIPPOWER 0x02
|
|
#define ES8328_CHIPPOWER_DACVREF_OFF 0
|
|
#define ES8328_CHIPPOWER_ADCVREF_OFF 1
|
|
#define ES8328_CHIPPOWER_DACDLL_OFF 2
|
|
#define ES8328_CHIPPOWER_ADCDLL_OFF 3
|
|
#define ES8328_CHIPPOWER_DACSTM_RESET 4
|
|
#define ES8328_CHIPPOWER_ADCSTM_RESET 5
|
|
#define ES8328_CHIPPOWER_DACDIG_OFF 6
|
|
#define ES8328_CHIPPOWER_ADCDIG_OFF 7
|
|
|
|
#define ES8328_ADCPOWER 0x03
|
|
#define ES8328_ADCPOWER_INT1_LOWPOWER 0
|
|
#define ES8328_ADCPOWER_FLASH_ADC_LOWPOWER 1
|
|
#define ES8328_ADCPOWER_ADC_BIAS_GEN_OFF 2
|
|
#define ES8328_ADCPOWER_MIC_BIAS_OFF 3
|
|
#define ES8328_ADCPOWER_ADCR_OFF 4
|
|
#define ES8328_ADCPOWER_ADCL_OFF 5
|
|
#define ES8328_ADCPOWER_AINR_OFF 6
|
|
#define ES8328_ADCPOWER_AINL_OFF 7
|
|
|
|
#define ES8328_DACPOWER 0x04
|
|
#define ES8328_DACPOWER_OUT3_ON 0
|
|
#define ES8328_DACPOWER_MONO_ON 1
|
|
#define ES8328_DACPOWER_ROUT2_ON 2
|
|
#define ES8328_DACPOWER_LOUT2_ON 3
|
|
#define ES8328_DACPOWER_ROUT1_ON 4
|
|
#define ES8328_DACPOWER_LOUT1_ON 5
|
|
#define ES8328_DACPOWER_RDAC_OFF 6
|
|
#define ES8328_DACPOWER_LDAC_OFF 7
|
|
|
|
#define ES8328_CHIPLOPOW1 0x05
|
|
#define ES8328_CHIPLOPOW2 0x06
|
|
#define ES8328_ANAVOLMANAG 0x07
|
|
|
|
#define ES8328_MASTERMODE 0x08
|
|
#define ES8328_MASTERMODE_BCLKDIV (0 << 0)
|
|
#define ES8328_MASTERMODE_BCLK_INV (1 << 5)
|
|
#define ES8328_MASTERMODE_MCLKDIV2 (1 << 6)
|
|
#define ES8328_MASTERMODE_MSC (1 << 7)
|
|
|
|
#define ES8328_ADCCONTROL1 0x09
|
|
#define ES8328_ADCCONTROL2 0x0a
|
|
#define ES8328_ADCCONTROL3 0x0b
|
|
|
|
#define ES8328_ADCCONTROL4 0x0c
|
|
#define ES8328_ADCCONTROL4_ADCFORMAT_MASK (3 << 0)
|
|
#define ES8328_ADCCONTROL4_ADCFORMAT_I2S (0 << 0)
|
|
#define ES8328_ADCCONTROL4_ADCFORMAT_LJUST (1 << 0)
|
|
#define ES8328_ADCCONTROL4_ADCFORMAT_RJUST (2 << 0)
|
|
#define ES8328_ADCCONTROL4_ADCFORMAT_PCM (3 << 0)
|
|
#define ES8328_ADCCONTROL4_ADCWL_SHIFT 2
|
|
#define ES8328_ADCCONTROL4_ADCWL_MASK (7 << 2)
|
|
#define ES8328_ADCCONTROL4_ADCLRP_I2S_POL_NORMAL (0 << 5)
|
|
#define ES8328_ADCCONTROL4_ADCLRP_I2S_POL_INV (1 << 5)
|
|
#define ES8328_ADCCONTROL4_ADCLRP_PCM_MSB_CLK2 (0 << 5)
|
|
#define ES8328_ADCCONTROL4_ADCLRP_PCM_MSB_CLK1 (1 << 5)
|
|
|
|
#define ES8328_ADCCONTROL5 0x0d
|
|
#define ES8328_ADCCONTROL5_RATEMASK (0x1f << 0)
|
|
|
|
#define ES8328_ADCCONTROL6 0x0e
|
|
|
|
#define ES8328_ADCCONTROL7 0x0f
|
|
#define ES8328_ADCCONTROL7_ADC_MUTE (1 << 2)
|
|
#define ES8328_ADCCONTROL7_ADC_LER (1 << 3)
|
|
#define ES8328_ADCCONTROL7_ADC_ZERO_CROSS (1 << 4)
|
|
#define ES8328_ADCCONTROL7_ADC_SOFT_RAMP (1 << 5)
|
|
#define ES8328_ADCCONTROL7_ADC_RAMP_RATE_4 (0 << 6)
|
|
#define ES8328_ADCCONTROL7_ADC_RAMP_RATE_8 (1 << 6)
|
|
#define ES8328_ADCCONTROL7_ADC_RAMP_RATE_16 (2 << 6)
|
|
#define ES8328_ADCCONTROL7_ADC_RAMP_RATE_32 (3 << 6)
|
|
|
|
#define ES8328_ADCCONTROL8 0x10
|
|
#define ES8328_ADCCONTROL9 0x11
|
|
#define ES8328_ADCCONTROL10 0x12
|
|
#define ES8328_ADCCONTROL11 0x13
|
|
#define ES8328_ADCCONTROL12 0x14
|
|
#define ES8328_ADCCONTROL13 0x15
|
|
#define ES8328_ADCCONTROL14 0x16
|
|
|
|
#define ES8328_DACCONTROL1 0x17
|
|
#define ES8328_DACCONTROL1_DACFORMAT_MASK (3 << 1)
|
|
#define ES8328_DACCONTROL1_DACFORMAT_I2S (0 << 1)
|
|
#define ES8328_DACCONTROL1_DACFORMAT_LJUST (1 << 1)
|
|
#define ES8328_DACCONTROL1_DACFORMAT_RJUST (2 << 1)
|
|
#define ES8328_DACCONTROL1_DACFORMAT_PCM (3 << 1)
|
|
#define ES8328_DACCONTROL1_DACWL_SHIFT 3
|
|
#define ES8328_DACCONTROL1_DACWL_MASK (7 << 3)
|
|
#define ES8328_DACCONTROL1_DACLRP_I2S_POL_NORMAL (0 << 6)
|
|
#define ES8328_DACCONTROL1_DACLRP_I2S_POL_INV (1 << 6)
|
|
#define ES8328_DACCONTROL1_DACLRP_PCM_MSB_CLK2 (0 << 6)
|
|
#define ES8328_DACCONTROL1_DACLRP_PCM_MSB_CLK1 (1 << 6)
|
|
#define ES8328_DACCONTROL1_LRSWAP (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL2 0x18
|
|
#define ES8328_DACCONTROL2_RATEMASK (0x1f << 0)
|
|
#define ES8328_DACCONTROL2_DOUBLESPEED (1 << 5)
|
|
|
|
#define ES8328_DACCONTROL3 0x19
|
|
#define ES8328_DACCONTROL3_AUTOMUTE (1 << 2)
|
|
#define ES8328_DACCONTROL3_DACMUTE (1 << 2)
|
|
#define ES8328_DACCONTROL3_LEFTGAINVOL (1 << 3)
|
|
#define ES8328_DACCONTROL3_DACZEROCROSS (1 << 4)
|
|
#define ES8328_DACCONTROL3_DACSOFTRAMP (1 << 5)
|
|
#define ES8328_DACCONTROL3_DACRAMPRATE (3 << 6)
|
|
|
|
#define ES8328_LDACVOL 0x1a
|
|
#define ES8328_LDACVOL_MASK (0 << 0)
|
|
#define ES8328_LDACVOL_MAX (0xc0)
|
|
|
|
#define ES8328_RDACVOL 0x1b
|
|
#define ES8328_RDACVOL_MASK (0 << 0)
|
|
#define ES8328_RDACVOL_MAX (0xc0)
|
|
|
|
#define ES8328_DACVOL_MAX (0xc0)
|
|
|
|
#define ES8328_DACCONTROL4 0x1a
|
|
#define ES8328_DACCONTROL5 0x1b
|
|
|
|
#define ES8328_DACCONTROL6 0x1c
|
|
#define ES8328_DACCONTROL6_CLICKFREE (1 << 3)
|
|
#define ES8328_DACCONTROL6_DAC_INVR (1 << 4)
|
|
#define ES8328_DACCONTROL6_DAC_INVL (1 << 5)
|
|
#define ES8328_DACCONTROL6_DEEMPH_MASK (3 << 6)
|
|
#define ES8328_DACCONTROL6_DEEMPH_OFF (0 << 6)
|
|
#define ES8328_DACCONTROL6_DEEMPH_32k (1 << 6)
|
|
#define ES8328_DACCONTROL6_DEEMPH_44_1k (2 << 6)
|
|
#define ES8328_DACCONTROL6_DEEMPH_48k (3 << 6)
|
|
|
|
#define ES8328_DACCONTROL7 0x1d
|
|
#define ES8328_DACCONTROL7_VPP_SCALE_3p5 (0 << 0)
|
|
#define ES8328_DACCONTROL7_VPP_SCALE_4p0 (1 << 0)
|
|
#define ES8328_DACCONTROL7_VPP_SCALE_3p0 (2 << 0)
|
|
#define ES8328_DACCONTROL7_VPP_SCALE_2p5 (3 << 0)
|
|
#define ES8328_DACCONTROL7_SHELVING_STRENGTH (1 << 2) /* In eights */
|
|
#define ES8328_DACCONTROL7_MONO (1 << 5)
|
|
#define ES8328_DACCONTROL7_ZEROR (1 << 6)
|
|
#define ES8328_DACCONTROL7_ZEROL (1 << 7)
|
|
|
|
/* Shelving filter */
|
|
#define ES8328_DACCONTROL8 0x1e
|
|
#define ES8328_DACCONTROL9 0x1f
|
|
#define ES8328_DACCONTROL10 0x20
|
|
#define ES8328_DACCONTROL11 0x21
|
|
#define ES8328_DACCONTROL12 0x22
|
|
#define ES8328_DACCONTROL13 0x23
|
|
#define ES8328_DACCONTROL14 0x24
|
|
#define ES8328_DACCONTROL15 0x25
|
|
|
|
#define ES8328_DACCONTROL16 0x26
|
|
#define ES8328_DACCONTROL16_RMIXSEL_RIN1 (0 << 0)
|
|
#define ES8328_DACCONTROL16_RMIXSEL_RIN2 (1 << 0)
|
|
#define ES8328_DACCONTROL16_RMIXSEL_RIN3 (2 << 0)
|
|
#define ES8328_DACCONTROL16_RMIXSEL_RADC (3 << 0)
|
|
#define ES8328_DACCONTROL16_LMIXSEL_LIN1 (0 << 3)
|
|
#define ES8328_DACCONTROL16_LMIXSEL_LIN2 (1 << 3)
|
|
#define ES8328_DACCONTROL16_LMIXSEL_LIN3 (2 << 3)
|
|
#define ES8328_DACCONTROL16_LMIXSEL_LADC (3 << 3)
|
|
|
|
#define ES8328_DACCONTROL17 0x27
|
|
#define ES8328_DACCONTROL17_LI2LOVOL (7 << 3)
|
|
#define ES8328_DACCONTROL17_LI2LO (1 << 6)
|
|
#define ES8328_DACCONTROL17_LD2LO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL18 0x28
|
|
#define ES8328_DACCONTROL18_RI2LOVOL (7 << 3)
|
|
#define ES8328_DACCONTROL18_RI2LO (1 << 6)
|
|
#define ES8328_DACCONTROL18_RD2LO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL19 0x29
|
|
#define ES8328_DACCONTROL19_LI2ROVOL (7 << 3)
|
|
#define ES8328_DACCONTROL19_LI2RO (1 << 6)
|
|
#define ES8328_DACCONTROL19_LD2RO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL20 0x2a
|
|
#define ES8328_DACCONTROL20_RI2ROVOL (7 << 3)
|
|
#define ES8328_DACCONTROL20_RI2RO (1 << 6)
|
|
#define ES8328_DACCONTROL20_RD2RO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL21 0x2b
|
|
#define ES8328_DACCONTROL21_LI2MOVOL (7 << 3)
|
|
#define ES8328_DACCONTROL21_LI2MO (1 << 6)
|
|
#define ES8328_DACCONTROL21_LD2MO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL22 0x2c
|
|
#define ES8328_DACCONTROL22_RI2MOVOL (7 << 3)
|
|
#define ES8328_DACCONTROL22_RI2MO (1 << 6)
|
|
#define ES8328_DACCONTROL22_RD2MO (1 << 7)
|
|
|
|
#define ES8328_DACCONTROL23 0x2d
|
|
#define ES8328_DACCONTROL23_MOUTINV (1 << 1)
|
|
#define ES8328_DACCONTROL23_HPSWPOL (1 << 2)
|
|
#define ES8328_DACCONTROL23_HPSWEN (1 << 3)
|
|
#define ES8328_DACCONTROL23_VROI_1p5k (0 << 4)
|
|
#define ES8328_DACCONTROL23_VROI_40k (1 << 4)
|
|
#define ES8328_DACCONTROL23_OUT3_VREF (0 << 5)
|
|
#define ES8328_DACCONTROL23_OUT3_ROUT1 (1 << 5)
|
|
#define ES8328_DACCONTROL23_OUT3_MONOOUT (2 << 5)
|
|
#define ES8328_DACCONTROL23_OUT3_RIGHT_MIXER (3 << 5)
|
|
#define ES8328_DACCONTROL23_ROUT2INV (1 << 7)
|
|
|
|
/* LOUT1 Amplifier */
|
|
#define ES8328_LOUT1VOL 0x2e
|
|
#define ES8328_LOUT1VOL_MASK (0 << 5)
|
|
#define ES8328_LOUT1VOL_MAX (0x24)
|
|
|
|
/* ROUT1 Amplifier */
|
|
#define ES8328_ROUT1VOL 0x2f
|
|
#define ES8328_ROUT1VOL_MASK (0 << 5)
|
|
#define ES8328_ROUT1VOL_MAX (0x24)
|
|
|
|
#define ES8328_OUT1VOL_MAX (0x24)
|
|
|
|
/* LOUT2 Amplifier */
|
|
#define ES8328_LOUT2VOL 0x30
|
|
#define ES8328_LOUT2VOL_MASK (0 << 5)
|
|
#define ES8328_LOUT2VOL_MAX (0x24)
|
|
|
|
/* ROUT2 Amplifier */
|
|
#define ES8328_ROUT2VOL 0x31
|
|
#define ES8328_ROUT2VOL_MASK (0 << 5)
|
|
#define ES8328_ROUT2VOL_MAX (0x24)
|
|
|
|
#define ES8328_OUT2VOL_MAX (0x24)
|
|
|
|
/* Mono Out Amplifier */
|
|
#define ES8328_MONOOUTVOL 0x32
|
|
#define ES8328_MONOOUTVOL_MASK (0 << 5)
|
|
#define ES8328_MONOOUTVOL_MAX (0x24)
|
|
|
|
#define ES8328_DACCONTROL29 0x33
|
|
#define ES8328_DACCONTROL30 0x34
|
|
|
|
#define ES8328_SYSCLK 0
|
|
|
|
#define ES8328_REG_MAX 0x35
|
|
|
|
#define ES8328_1536FS 1536
|
|
#define ES8328_1024FS 1024
|
|
#define ES8328_768FS 768
|
|
#define ES8328_512FS 512
|
|
#define ES8328_384FS 384
|
|
#define ES8328_256FS 256
|
|
#define ES8328_128FS 128
|
|
|
|
#endif
|