xref: /netbsd-src/sys/dev/i2c/tea5767reg.h (revision 214d4ae2aca4177d5cbd08a1926f17f04d1b609c)
1 /*	$NetBSD: tea5767reg.h,v 1.1 2018/07/27 12:02:26 rkujawa Exp $	*/
2 /*-
3  * Copyright (c) 2018 The NetBSD Foundation, Inc.
4  * All rights reserved.
5  *
6  * This code is derived from software contributed to The NetBSD Foundation
7  * by Karuna Grewal.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  * 1. Redistributions of source code must retain the above copyright
13  *    notice, this list of conditions and the following disclaimer.
14  * 2. Redistributions in binary form must reproduce the above copyright
15  *    notice, this list of conditions and the following disclaimer in the
16  *    documentation and/or other materials provided with the distribution.
17  *
18  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
19  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
20  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
21  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
22  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
25  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
26  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
27  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef __TEA5767REG_H__
32 #define __TEA5767REG_H__
33 
34 /* TEA5767 ADDR */
35 #define TEA5767_ADDR                0x60
36 
37 /* 1st byte */
38 #define TEA5767_MUTE                0x80    /* Set Mute */
39 #define TEA5767_SEARCH              0x40    /* Activate search Mode */
40 
41 /* 3rd byte */
42 #define TEA5767_SUD                 0x80    /* Search Up */
43 #define TEA5767_SSL_1               0x60    /* ADC o/p = 10 */
44 #define TEA5767_SSL_2               0x40    /* ADC o/p = 7 */
45 #define TEA5767_SSL_3               0x20    /* ADC o/p = 5 */
46 #define TEA5767_MONO                0x08    /* Force Mono */
47 #define TEA5767_MUTE_R              0x04    /* Mute Right */
48 #define TEA5767_MUTE_L              0x02    /* Mute Left */
49 
50 /* 4th byte */
51 #define TEA5767_STANDBY             0x40
52 #define TEA5767_FM_BAND             0x20    /* Set Japanese FM Band */
53 #define TEA5767_XTAL                0x10
54 #define TEA5767_SMUTE               0x08
55 #define TEA5767_SNC                 0x02    /* Stereo Noise Cancelling */
56 #define TEA5767_SEARCH_IND          0x01
57 
58 /* 5th byte */
59 #define TEA5767_PLLREF              0x80    /* If enabled TEA5767_CLK_FREQ : 6.5MHZ*/
60 
61 /* Read Mode MASKS*/
62 
63 /* 1st byte */
64 #define TEA5767_READY_FLAG          0x80
65 #define TEA5767_BAND_LIMIT          0X40
66 
67 /* 3rd byte */
68 #define TEA5767_STEREO              0x80
69 #define TEA5767_IF_COUNTER          0x7f
70 
71 /* 4th byte */
72 #define TEA5767_ADC_LEVEL           0xf0
73 
74 /* Kernel Config Maps */
75 #define TEA5767_JAPAN_FM_FLAG       0x01
76 #define TEA5767_PLL_FLAG            0x02
77 #define TEA5767_XTAL_FLAG           0x04
78 #define TEA5767_FORCE_SRCH_FLAG     0x08
79 #endif
80