Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * wm8731.h  --  WM8731 Soc Audio driver
0004  *
0005  * Copyright 2005 Openedhand Ltd.
0006  *
0007  * Author: Richard Purdie <richard@openedhand.com>
0008  *
0009  * Based on wm8753.h
0010  */
0011 
0012 #ifndef _WM8731_H
0013 #define _WM8731_H
0014 
0015 #include <linux/mutex.h>
0016 #include <linux/regmap.h>
0017 #include <linux/regulator/consumer.h>
0018 
0019 struct clk;
0020 struct snd_pcm_hw_constraint_list;
0021 
0022 /* WM8731 register space */
0023 
0024 #define WM8731_LINVOL   0x00
0025 #define WM8731_RINVOL   0x01
0026 #define WM8731_LOUT1V   0x02
0027 #define WM8731_ROUT1V   0x03
0028 #define WM8731_APANA    0x04
0029 #define WM8731_APDIGI   0x05
0030 #define WM8731_PWR      0x06
0031 #define WM8731_IFACE    0x07
0032 #define WM8731_SRATE    0x08
0033 #define WM8731_ACTIVE   0x09
0034 #define WM8731_RESET    0x0f
0035 
0036 #define WM8731_CACHEREGNUM  10
0037 
0038 #define WM8731_SYSCLK_MCLK 0
0039 #define WM8731_SYSCLK_XTAL 1
0040 
0041 #define WM8731_DAI      0
0042 
0043 #define WM8731_NUM_SUPPLIES 4
0044 
0045 /* codec private data */
0046 struct wm8731_priv {
0047     struct regmap *regmap;
0048     struct clk *mclk;
0049     struct regulator_bulk_data supplies[WM8731_NUM_SUPPLIES];
0050     const struct snd_pcm_hw_constraint_list *constraints;
0051     unsigned int sysclk;
0052     int sysclk_type;
0053     int playback_fs;
0054     bool deemph;
0055 
0056     struct mutex lock;
0057 };
0058 
0059 extern const struct regmap_config wm8731_regmap;
0060 
0061 int wm8731_init(struct device *dev, struct wm8731_priv *wm8731);
0062 
0063 #endif