<commit_before>/*
 * wm9712.c  --  ALSA Soc WM9712 codec support
 *
 * Copyright 2006 Wolfson Microelectronics PLC.
 * Author: <NAME>
 *         <EMAIL> or <EMAIL>
 *
 *  This program is free software; you can redistribute  it and/or modify it
 *  under  the terms of  the GNU General  Public License as published by the
 *  Free Software Foundation;  either version 2 of the  License, or (at your
 *  option) any later version.
 *
 *  Revision history
 *    4th Feb 2006   Initial version.
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>

#define WM9712_VERSION "0.4"

static unsigned int ac97_read(struct snd_soc_codec *codec,
	unsigned int reg);
static int ac97_write(struct snd_soc_codec *codec,
	unsigned int reg, unsigned int val);

#define AC97_DIR \
	(SND_SOC_DAIDIR_PLAYBACK | SND_SOC_DAIDIR_CAPTURE)

#define AC97_RATES \
	(SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
	SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
	SNDRV_PCM_RATE_48000)

/* may need to expand this */
static struct snd_soc_dai_mode ac97_modes[] = {
	{
		.pcmfmt = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE,	
		.pcmrate = AC97_RATES,
		.pcmdir = AC97_DIR,
	},
};

/*
 * WM9712 register cache
 */
static const u16 wm9712_reg[] = {
	0x6174, 0x8000, 0x8000, 0x8000, // 6
	0xf0f0, 0xaaa0, 0xc008, 0x6808, // e
	0xe808, 0xaaa0, 0xad00, 0x8000, // 16
	0xe808, 0x3000, 0x8000, 0x0000, // 1e
	0x0000, 0x0000, 0x0000, 0x000f, // 26
	0x0405, 0x0410, 0xbb80, 0xbb80, // 2e
	0x0000, 0xbb80, 0x0000, 0x0000, // 36
	0x0000, 0x2000, 0x0000, 0x0000, // 3e
	0x0000, 0x0000, 0x0000, 0x0000, // 46
	0x0000, 0x0000, 0xf83e, 0xffff, // 4e
	0x0000, 0x0000, 0x0000, 0xf83e, // 56
	0x0008, 0x0000, 0x0000, 0x0000, // 5e
	0xb032, 0x3e00, 0x0000, 0x0000, // 66
	0x0000, 0x0000, 0x0000, 0x0000, // 6e
	0x0000, 0x0000, 0x0000, 0x0006, // 76<commit_msg>[ALSA] Remove trailing white space from wm9712.c<commit_after>/*
 * wm9712.c  --  ALSA Soc WM9712 codec support
 *
 * Copyright 2006 Wolfson Microelectronics PLC.
 * Author: <NAME>
 *         <EMAIL> or <EMAIL>
 *
 *  This program is free software; you can redistribute  it and/or modify it
 *  under  the terms of  the GNU General  Public License as published by the
 *  Free Software Foundation;  either version 2 of the  License, or (at your
 *  option) any later version.
 *
 *  Revision history
 *    4th Feb 2006   Initial version.
 */

#include <linux/init.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/device.h>
#include <sound/driver.h>
#include <sound/core.h>
#include <sound/pcm.h>
#include <sound/ac97_codec.h>
#include <sound/initval.h>
#include <sound/soc.h>
#include <sound/soc-dapm.h>

#define WM9712_VERSION "0.4"

static unsigned int ac97_read(struct snd_soc_codec *codec,
	unsigned int reg);
static int ac97_write(struct snd_soc_codec *codec,
	unsigned int reg, unsigned int val);

#define AC97_DIR \
	(SND_SOC_DAIDIR_PLAYBACK | SND_SOC_DAIDIR_CAPTURE)

#define AC97_RATES \
	(SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_11025 | SNDRV_PCM_RATE_16000 | \
	SNDRV_PCM_RATE_22050 | SNDRV_PCM_RATE_32000 | SNDRV_PCM_RATE_44100 | \
	SNDRV_PCM_RATE_48000)

/* may need to expand this */
static struct snd_soc_dai_mode ac97_modes[] = {
	{
		.pcmfmt = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S18_3LE,
		.pcmrate = AC97_RATES,
		.pcmdir = AC97_DIR,
	},
};

/*
 * WM9712 register cache
 */
static const u16 wm9712_reg[] = {
	0x6174, 0x8000, 0x8000, 0x8000, // 6
	0xf0f0, 0xaaa0, 0xc008, 0x6808, // e
	0xe808, 0xaaa0, 0xad00, 0x8000, // 16
	0xe808, 0x3000, 0x8000, 0x0000, // 1e
	0x0000, 0x0000, 0x0000, 0x000f, // 26
	0x0405, 0x0410, 0xbb80, 0xbb80, // 2e
	0x0000, 0xbb80, 0x0000, 0x0000, // 36
	0x0000, 0x2000, 0x0000, 0x0000, // 3e
	0x0000, 0x0000, 0x0000, 0x0000, // 46
	0x0000, 0x0000, 0xf83e, 0xffff, // 4e
	0x0000, 0x0000, 0x0000, 0xf83e, // 56
	0x0008, 0x0000, 0x0000, 0x0000, // 5e
	0xb032, 0x3e00, 0x0000, 0x0000, // 66
	0x0000, 0x0000, 0x0000, 0x0000, // 6e
	0x0000, 0x0000, 0x0000, 0x0006, // 76
{'fraction_non_alphanumeric': 0.11911421911421911, 'fraction_numerical': 0.1780885780885781, 'mean_word_length': 3.904, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5254495', 'n_tokens_mistral': 2378, 'n_tokens_neox': 1834, 'n_words': 451}