nau8325.c
Includes Linux kernel module headerAssigns a negative errno constant
SHA-25630ca507f8cadec7f880249968302124c90f0cd0a474efca0f6394564142f27b8
MaleculeO(Er)H(Os)
Evidence
6:33… on.com>
7// David Lin <[email protected]>
8//
9
10#include <linux/clk.h>
11#include <linux/delay.h>
12#include <linux/init.h>
13#include <linux/i2c.h>
14#include <linux/module.h>
15#include <linux/regmap.h>
16#include <linux/slab.h>
17#include <sound/core.h>
18#include <sound/initval.h>
19#include <sound/pcm.h>
20#include <sound/pcm_params.h>
21#include <sound/soc.h>
22#include <sound/tlv.h>
23#include "nau8325.h"
24
25/* Range of Master Clock MCLK (Hz) */
26#define MASTER_CLK_MAX 49152000
27#define MASTER_CLK_MIN 2048000
28
29/* scaling for MCLK source */
30#define CLK_PROC_BYPASS (-1)
31
32/* the maximum CLK_DAC */
33#define CLK_DA_AD_MAX 6144000
34
⋯4 lines
63:11… },
64 { 2, 0x3 },
65 { 3, 0x4 },
66};
67
68/* Sample Rate and MCLK_SRC selections */
69static const struct nau8325_srate_attr target_srate_table[] = {
70 /* { FS …
231:18… FT_MUTE, NAU8325_SOFT_MUTE);
232 msleep(30);
233 break;
234 default:
235 return -EINVAL;
236 }
237
⋯5 lines
514:5… (!osr || !osr->osr || nau8325->fs * osr->osr > CLK_DA_AD_MAX) {
515 ret = -EINVAL;
516 goto err;
517 }
518 regmap_update_bits(nau8325->regmap, NAU8325_R03_CLK_CTRL,
519 NAU8325_CLK_DAC_SRC_MASK,
520 osr->clk_src << …