162306a36Sopenharmony_ci/*
262306a36Sopenharmony_ci * Copyright (c) 2015 NVIDIA Corporation. All rights reserved.
362306a36Sopenharmony_ci *
462306a36Sopenharmony_ci * Permission is hereby granted, free of charge, to any person obtaining a
562306a36Sopenharmony_ci * copy of this software and associated documentation files (the "Software"),
662306a36Sopenharmony_ci * to deal in the Software without restriction, including without limitation
762306a36Sopenharmony_ci * the rights to use, copy, modify, merge, publish, distribute, sub license,
862306a36Sopenharmony_ci * and/or sell copies of the Software, and to permit persons to whom the
962306a36Sopenharmony_ci * Software is furnished to do so, subject to the following conditions:
1062306a36Sopenharmony_ci *
1162306a36Sopenharmony_ci * The above copyright notice and this permission notice (including the
1262306a36Sopenharmony_ci * next paragraph) shall be included in all copies or substantial portions
1362306a36Sopenharmony_ci * of the Software.
1462306a36Sopenharmony_ci *
1562306a36Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1662306a36Sopenharmony_ci * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1762306a36Sopenharmony_ci * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
1862306a36Sopenharmony_ci * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1962306a36Sopenharmony_ci * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
2062306a36Sopenharmony_ci * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
2162306a36Sopenharmony_ci * DEALINGS IN THE SOFTWARE.
2262306a36Sopenharmony_ci */
2362306a36Sopenharmony_ci
2462306a36Sopenharmony_ci#ifndef DRM_SCDC_H
2562306a36Sopenharmony_ci#define DRM_SCDC_H
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_ci#define SCDC_SINK_VERSION 0x01
2862306a36Sopenharmony_ci
2962306a36Sopenharmony_ci#define SCDC_SOURCE_VERSION 0x02
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci#define SCDC_UPDATE_0 0x10
3262306a36Sopenharmony_ci#define  SCDC_READ_REQUEST_TEST (1 << 2)
3362306a36Sopenharmony_ci#define  SCDC_CED_UPDATE (1 << 1)
3462306a36Sopenharmony_ci#define  SCDC_STATUS_UPDATE (1 << 0)
3562306a36Sopenharmony_ci
3662306a36Sopenharmony_ci#define SCDC_UPDATE_1 0x11
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_ci#define SCDC_TMDS_CONFIG 0x20
3962306a36Sopenharmony_ci#define  SCDC_TMDS_BIT_CLOCK_RATIO_BY_40 (1 << 1)
4062306a36Sopenharmony_ci#define  SCDC_TMDS_BIT_CLOCK_RATIO_BY_10 (0 << 1)
4162306a36Sopenharmony_ci#define  SCDC_SCRAMBLING_ENABLE (1 << 0)
4262306a36Sopenharmony_ci
4362306a36Sopenharmony_ci#define SCDC_SCRAMBLER_STATUS 0x21
4462306a36Sopenharmony_ci#define  SCDC_SCRAMBLING_STATUS (1 << 0)
4562306a36Sopenharmony_ci
4662306a36Sopenharmony_ci#define SCDC_CONFIG_0 0x30
4762306a36Sopenharmony_ci#define  SCDC_READ_REQUEST_ENABLE (1 << 0)
4862306a36Sopenharmony_ci
4962306a36Sopenharmony_ci#define SCDC_STATUS_FLAGS_0 0x40
5062306a36Sopenharmony_ci#define  SCDC_CH2_LOCK (1 << 3)
5162306a36Sopenharmony_ci#define  SCDC_CH1_LOCK (1 << 2)
5262306a36Sopenharmony_ci#define  SCDC_CH0_LOCK (1 << 1)
5362306a36Sopenharmony_ci#define  SCDC_CH_LOCK_MASK (SCDC_CH2_LOCK | SCDC_CH1_LOCK | SCDC_CH0_LOCK)
5462306a36Sopenharmony_ci#define  SCDC_CLOCK_DETECT (1 << 0)
5562306a36Sopenharmony_ci
5662306a36Sopenharmony_ci#define SCDC_STATUS_FLAGS_1 0x41
5762306a36Sopenharmony_ci
5862306a36Sopenharmony_ci#define SCDC_ERR_DET_0_L 0x50
5962306a36Sopenharmony_ci#define SCDC_ERR_DET_0_H 0x51
6062306a36Sopenharmony_ci#define SCDC_ERR_DET_1_L 0x52
6162306a36Sopenharmony_ci#define SCDC_ERR_DET_1_H 0x53
6262306a36Sopenharmony_ci#define SCDC_ERR_DET_2_L 0x54
6362306a36Sopenharmony_ci#define SCDC_ERR_DET_2_H 0x55
6462306a36Sopenharmony_ci#define  SCDC_CHANNEL_VALID (1 << 7)
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_ci#define SCDC_ERR_DET_CHECKSUM 0x56
6762306a36Sopenharmony_ci
6862306a36Sopenharmony_ci#define SCDC_TEST_CONFIG_0 0xc0
6962306a36Sopenharmony_ci#define  SCDC_TEST_READ_REQUEST (1 << 7)
7062306a36Sopenharmony_ci#define  SCDC_TEST_READ_REQUEST_DELAY(x) ((x) & 0x7f)
7162306a36Sopenharmony_ci
7262306a36Sopenharmony_ci#define SCDC_MANUFACTURER_IEEE_OUI 0xd0
7362306a36Sopenharmony_ci#define SCDC_MANUFACTURER_IEEE_OUI_SIZE 3
7462306a36Sopenharmony_ci
7562306a36Sopenharmony_ci#define SCDC_DEVICE_ID 0xd3
7662306a36Sopenharmony_ci#define SCDC_DEVICE_ID_SIZE 8
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci#define SCDC_DEVICE_HARDWARE_REVISION 0xdb
7962306a36Sopenharmony_ci#define  SCDC_GET_DEVICE_HARDWARE_REVISION_MAJOR(x) (((x) >> 4) & 0xf)
8062306a36Sopenharmony_ci#define  SCDC_GET_DEVICE_HARDWARE_REVISION_MINOR(x) (((x) >> 0) & 0xf)
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci#define SCDC_DEVICE_SOFTWARE_MAJOR_REVISION 0xdc
8362306a36Sopenharmony_ci#define SCDC_DEVICE_SOFTWARE_MINOR_REVISION 0xdd
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci#define SCDC_MANUFACTURER_SPECIFIC 0xde
8662306a36Sopenharmony_ci#define SCDC_MANUFACTURER_SPECIFIC_SIZE 34
8762306a36Sopenharmony_ci
8862306a36Sopenharmony_ci#endif
89