162306a36Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (C) 2017 Gateworks Corporation
462306a36Sopenharmony_ci */
562306a36Sopenharmony_ci#ifndef _DT_BINDINGS_MEDIA_TDA1997X_H
662306a36Sopenharmony_ci#define _DT_BINDINGS_MEDIA_TDA1997X_H
762306a36Sopenharmony_ci
862306a36Sopenharmony_ci/* TDA19973 36bit Video Port control registers */
962306a36Sopenharmony_ci#define TDA1997X_VP36_35_32	0
1062306a36Sopenharmony_ci#define TDA1997X_VP36_31_28	1
1162306a36Sopenharmony_ci#define TDA1997X_VP36_27_24	2
1262306a36Sopenharmony_ci#define TDA1997X_VP36_23_20	3
1362306a36Sopenharmony_ci#define TDA1997X_VP36_19_16	4
1462306a36Sopenharmony_ci#define TDA1997X_VP36_15_12	5
1562306a36Sopenharmony_ci#define TDA1997X_VP36_11_08	6
1662306a36Sopenharmony_ci#define TDA1997X_VP36_07_04	7
1762306a36Sopenharmony_ci#define TDA1997X_VP36_03_00	8
1862306a36Sopenharmony_ci
1962306a36Sopenharmony_ci/* TDA19971 24bit Video Port control registers */
2062306a36Sopenharmony_ci#define TDA1997X_VP24_V23_20	0
2162306a36Sopenharmony_ci#define TDA1997X_VP24_V19_16	1
2262306a36Sopenharmony_ci#define TDA1997X_VP24_V15_12	3
2362306a36Sopenharmony_ci#define TDA1997X_VP24_V11_08	4
2462306a36Sopenharmony_ci#define TDA1997X_VP24_V07_04	6
2562306a36Sopenharmony_ci#define TDA1997X_VP24_V03_00	7
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci/* Pin groups */
2862306a36Sopenharmony_ci#define TDA1997X_VP_OUT_EN        0x80	/* enable output group */
2962306a36Sopenharmony_ci#define TDA1997X_VP_HIZ           0x40	/* hi-Z output group when not used */
3062306a36Sopenharmony_ci#define TDA1997X_VP_SWP           0x10	/* pin-swap output group */
3162306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_3_0    (0 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3262306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_7_4    (1 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3362306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_11_8   (2 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3462306a36Sopenharmony_ci#define TDA1997X_B_CB_3_0         (3 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3562306a36Sopenharmony_ci#define TDA1997X_B_CB_7_4         (4 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3662306a36Sopenharmony_ci#define TDA1997X_B_CB_11_8        (5 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3762306a36Sopenharmony_ci#define TDA1997X_G_Y_3_0          (6 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3862306a36Sopenharmony_ci#define TDA1997X_G_Y_7_4          (7 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
3962306a36Sopenharmony_ci#define TDA1997X_G_Y_11_8         (8 | TDA1997X_VP_OUT_EN | TDA1997X_VP_HIZ)
4062306a36Sopenharmony_ci/* pinswapped groups */
4162306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_3_0_S  (TDA1997X_R_CR_CBCR_3_0 | TDA1997X_VP_SWAP)
4262306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_7_4_S  (TDA1997X_R_CR_CBCR_7_4 | TDA1997X_VP_SWAP)
4362306a36Sopenharmony_ci#define TDA1997X_R_CR_CBCR_11_8_S (TDA1997X_R_CR_CBCR_11_8 | TDA1997X_VP_SWAP)
4462306a36Sopenharmony_ci#define TDA1997X_B_CB_3_0_S       (TDA1997X_B_CB_3_0 | TDA1997X_VP_SWAP)
4562306a36Sopenharmony_ci#define TDA1997X_B_CB_7_4_S       (TDA1997X_B_CB_7_4 | TDA1997X_VP_SWAP)
4662306a36Sopenharmony_ci#define TDA1997X_B_CB_11_8_S      (TDA1997X_B_CB_11_8 | TDA1997X_VP_SWAP)
4762306a36Sopenharmony_ci#define TDA1997X_G_Y_3_0_S        (TDA1997X_G_Y_3_0 | TDA1997X_VP_SWAP)
4862306a36Sopenharmony_ci#define TDA1997X_G_Y_7_4_S        (TDA1997X_G_Y_7_4 | TDA1997X_VP_SWAP)
4962306a36Sopenharmony_ci#define TDA1997X_G_Y_11_8_S       (TDA1997X_G_Y_11_8 | TDA1997X_VP_SWAP)
5062306a36Sopenharmony_ci
5162306a36Sopenharmony_ci/* Audio bus DAI format */
5262306a36Sopenharmony_ci#define TDA1997X_I2S16			1 /* I2S 16bit */
5362306a36Sopenharmony_ci#define TDA1997X_I2S32			2 /* I2S 32bit */
5462306a36Sopenharmony_ci#define TDA1997X_SPDIF			3 /* SPDIF */
5562306a36Sopenharmony_ci#define TDA1997X_OBA			4 /* One Bit Audio */
5662306a36Sopenharmony_ci#define TDA1997X_DST			5 /* Direct Stream Transfer */
5762306a36Sopenharmony_ci#define TDA1997X_I2S16_HBR		6 /* HBR straight in I2S 16bit mode */
5862306a36Sopenharmony_ci#define TDA1997X_I2S16_HBR_DEMUX	7 /* HBR demux in I2S 16bit mode */
5962306a36Sopenharmony_ci#define TDA1997X_I2S32_HBR_DEMUX	8 /* HBR demux in I2S 32bit mode */
6062306a36Sopenharmony_ci#define TDA1997X_SPDIF_HBR_DEMUX	9 /* HBR demux in SPDIF mode */
6162306a36Sopenharmony_ci
6262306a36Sopenharmony_ci/* Audio bus channel layout */
6362306a36Sopenharmony_ci#define TDA1997X_LAYOUT0	0	/* 2-channel */
6462306a36Sopenharmony_ci#define TDA1997X_LAYOUT1	1	/* 8-channel */
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci/* Audio bus clock */
6762306a36Sopenharmony_ci#define TDA1997X_ACLK_16FS	0
6862306a36Sopenharmony_ci#define TDA1997X_ACLK_32FS	1
6962306a36Sopenharmony_ci#define TDA1997X_ACLK_64FS	2
7062306a36Sopenharmony_ci#define TDA1997X_ACLK_128FS	3
7162306a36Sopenharmony_ci#define TDA1997X_ACLK_256FS	4
7262306a36Sopenharmony_ci#define TDA1997X_ACLK_512FS	5
7362306a36Sopenharmony_ci
7462306a36Sopenharmony_ci#endif /* _DT_BINDINGS_MEDIA_TDA1997X_H */
75