blob: 503d514ba6fad9874a2deb6b04922e309f82afaf [file] [log] [blame]
Sudheer Papothid61f0a42018-11-14 06:00:33 +05301/* SPDX-License-Identifier: GPL-2.0-only */
2/*
Karthikeyan Mani242c2b82019-03-01 18:43:10 -08003 * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
Sudheer Papothid61f0a42018-11-14 06:00:33 +05304 */
5
6#ifndef _SM8250_PORT_CONFIG
7#define _SM8250_PORT_CONFIG
8
9#include <soc/swr-common.h>
10
11#define WSA_MSTR_PORT_MASK 0xFF
12/*
13 * Add port configuration in the format
14 *{ si, off1, off2, hstart, hstop, wd_len, bp_mode, bgp_ctrl, lane_ctrl}
15 */
16
17static struct port_params wsa_frame_params_default[SWR_MSTR_PORT_LEN] = {
18 {7, 1, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
19 {31, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
Karthikeyan Mani242c2b82019-03-01 18:43:10 -080020 {63, 12, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF},
Sudheer Papothid61f0a42018-11-14 06:00:33 +053021 {7, 6, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
22 {31, 18, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
Karthikeyan Mani242c2b82019-03-01 18:43:10 -080023 {63, 13, 31, 0xFF, 0xFF, 0xFF, 0x1, 0xFF, 0xFF},
Sudheer Papothid61f0a42018-11-14 06:00:33 +053024 {15, 7, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
25 {15, 10, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},
26};
27
28static struct port_params rx_frame_params_default[SWR_MSTR_PORT_LEN] = {
29 {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1},
30 {31, 0, 0, 3, 6, 7, 0, 0xFF, 0},
31 {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0},
Laxminath Kasam1a4dd6d2019-04-02 15:21:54 +053032 {7, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0},
Sudheer Papothid61f0a42018-11-14 06:00:33 +053033 {0, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0},
34};
35
36static struct port_params rx_frame_params_dsd[SWR_MSTR_PORT_LEN] = {
37 {3, 0, 0, 0xFF, 0xFF, 1, 0xFF, 0xFF, 1},
38 {31, 0, 0, 3, 6, 7, 0, 0xFF, 0},
39 {31, 11, 11, 0xFF, 0xFF, 4, 1, 0xFF, 0},
40 {7, 9, 0, 0xFF, 0xFF, 0xFF, 0xFF, 1, 0},
41 {3, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 3, 0},
42};
43
44/* TX UC1: TX1: 1ch, TX2: 2chs, TX3: 1ch(MBHC) */
45static struct port_params tx_frame_params_default[SWR_MSTR_PORT_LEN] = {
Sudheer Papothi17875f52019-02-01 22:50:19 +053046 {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF},/* PCM OUT */
Sudheer Papothid61f0a42018-11-14 06:00:33 +053047 {1, 1, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX1 */
48 {1, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1}, /* TX2 */
49 {3, 2, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0}, /* TX3 */
Sudheer Papothi17875f52019-02-01 22:50:19 +053050 {3, 0, 0, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 1}, /* TX4 */
Sudheer Papothid61f0a42018-11-14 06:00:33 +053051};
52
53static struct swr_mstr_port_map sm_port_map[] = {
54 {TX_MACRO, SWR_UC0, tx_frame_params_default},
55 {RX_MACRO, SWR_UC0, rx_frame_params_default},
56 {RX_MACRO, SWR_UC1, rx_frame_params_dsd},
57 {WSA_MACRO, SWR_UC0, wsa_frame_params_default},
58};
59
60#endif /* _SM8250_PORT_CONFIG */