18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 2017 Gateworks Corporation
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci#ifndef _DT_BINDINGS_MEDIA_TDA1997X_H
68c2ecf20Sopenharmony_ci#define _DT_BINDINGS_MEDIA_TDA1997X_H
78c2ecf20Sopenharmony_ci
88c2ecf20Sopenharmony_ci/* TDA19973 36bit Video Port control registers */
98c2ecf20Sopenharmony_ci#define TDA1997X_VP36_35_32	0
108c2ecf20Sopenharmony_ci#define TDA1997X_VP36_31_28	1
118c2ecf20Sopenharmony_ci#define TDA1997X_VP36_27_24	2
128c2ecf20Sopenharmony_ci#define TDA1997X_VP36_23_20	3
138c2ecf20Sopenharmony_ci#define TDA1997X_VP36_19_16	4
148c2ecf20Sopenharmony_ci#define TDA1997X_VP36_15_12	5
158c2ecf20Sopenharmony_ci#define TDA1997X_VP36_11_08	6
168c2ecf20Sopenharmony_ci#define TDA1997X_VP36_07_04	7
178c2ecf20Sopenharmony_ci#define TDA1997X_VP36_03_00	8
188c2ecf20Sopenharmony_ci
198c2ecf20Sopenharmony_ci/* TDA19971 24bit Video Port control registers */
208c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V23_20	0
218c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V19_16	1
228c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V15_12	3
238c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V11_08	4
248c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V07_04	6
258c2ecf20Sopenharmony_ci#define TDA1997X_VP24_V03_00	7
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci/* Pin groups */
288c2ecf20Sopenharmony_ci#define TDA1997X_VP_OUT_EN        0x80	/* enable output group */
298c2ecf20Sopenharmony_ci#define TDA1997X_VP_HIZ           0x40	/* hi-Z output group when not used */
308c2ecf20Sopenharmony_ci#define TDA1997X_VP_SWP           0x10	/* pin-swap output group */
318c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_3_0    (0 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
328c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_7_4    (1 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
338c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_11_8   (2 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
348c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_3_0         (3 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
358c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_7_4         (4 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
368c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_11_8        (5 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
378c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_3_0          (6 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
388c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_7_4          (7 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
398c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_11_8         (8 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
408c2ecf20Sopenharmony_ci/* pinswapped groups */
418c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_3_0_S  (TDA1997X_R_CR_CBCR_3_0 | TDA1997X_VP_SWAP)
428c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_7_4_S  (TDA1997X_R_CR_CBCR_7_4 | TDA1997X_VP_SWAP)
438c2ecf20Sopenharmony_ci#define TDA1997X_R_CR_CBCR_11_8_S (TDA1997X_R_CR_CBCR_11_8 | TDA1997X_VP_SWAP)
448c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_3_0_S       (TDA1997X_B_CB_3_0 | TDA1997X_VP_SWAP)
458c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_7_4_S       (TDA1997X_B_CB_7_4 | TDA1997X_VP_SWAP)
468c2ecf20Sopenharmony_ci#define TDA1997X_B_CB_11_8_S      (TDA1997X_B_CB_11_8 | TDA1997X_VP_SWAP)
478c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_3_0_S        (TDA1997X_G_Y_3_0 | TDA1997X_VP_SWAP)
488c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_7_4_S        (TDA1997X_G_Y_7_4 | TDA1997X_VP_SWAP)
498c2ecf20Sopenharmony_ci#define TDA1997X_G_Y_11_8_S       (TDA1997X_G_Y_11_8 | TDA1997X_VP_SWAP)
508c2ecf20Sopenharmony_ci
518c2ecf20Sopenharmony_ci/* Audio bus DAI format */
528c2ecf20Sopenharmony_ci#define TDA1997X_I2S16			1 /* I2S 16bit */
538c2ecf20Sopenharmony_ci#define TDA1997X_I2S32			2 /* I2S 32bit */
548c2ecf20Sopenharmony_ci#define TDA1997X_SPDIF			3 /* SPDIF */
558c2ecf20Sopenharmony_ci#define TDA1997X_OBA			4 /* One Bit Audio */
568c2ecf20Sopenharmony_ci#define TDA1997X_DST			5 /* Direct Stream Transfer */
578c2ecf20Sopenharmony_ci#define TDA1997X_I2S16_HBR		6 /* HBR straight in I2S 16bit mode */
588c2ecf20Sopenharmony_ci#define TDA1997X_I2S16_HBR_DEMUX	7 /* HBR demux in I2S 16bit mode */
598c2ecf20Sopenharmony_ci#define TDA1997X_I2S32_HBR_DEMUX	8 /* HBR demux in I2S 32bit mode */
608c2ecf20Sopenharmony_ci#define TDA1997X_SPDIF_HBR_DEMUX	9 /* HBR demux in SPDIF mode */
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci/* Audio bus channel layout */
638c2ecf20Sopenharmony_ci#define TDA1997X_LAYOUT0	0	/* 2-channel */
648c2ecf20Sopenharmony_ci#define TDA1997X_LAYOUT1	1	/* 8-channel */
658c2ecf20Sopenharmony_ci
668c2ecf20Sopenharmony_ci/* Audio bus clock */
678c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_16FS	0
688c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_32FS	1
698c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_64FS	2
708c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_128FS	3
718c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_256FS	4
728c2ecf20Sopenharmony_ci#define TDA1997X_ACLK_512FS	5
738c2ecf20Sopenharmony_ci
748c2ecf20Sopenharmony_ci#endif /* _DT_BINDINGS_MEDIA_TDA1997X_H */
75