replace common qcom sources with samsung ones

This commit is contained in:
SaschaNes
2025-08-12 22:13:00 +02:00
parent ba24dcded9
commit 6f7753de11
5682 changed files with 2450203 additions and 103634 deletions

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
@@ -38,15 +38,13 @@ int btfm_get_bt_soc_index(int chipset_ver)
switch (chipset_ver) {
case QCA_GANGES_SOC_ID_0100:
case QCA_GANGES_SOC_ID_0200:
case QCA_ORNE_SOC_ID_0100:
case QCA_COLOGNE_SOC_ID_0100:
return GANGES;
case QCA_EVROS_SOC_ID_0100:
case QCA_EVROS_SOC_ID_0200:
return EVROS;
default:
BTFMSWR_ERR("no BT SOC id defined, returning GANGES");
return GANGES;
BTFMSWR_ERR("no BT SOC id defined, returning EVROS");
return EVROS;
}
}

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
@@ -34,9 +34,7 @@ enum {
FMAUDIO_TX = 0,
BTAUDIO_TX,
BTAUDIO_RX,
// align definitions to stream id definitions in CP
BTAUDIO_RX2,
BTAUDIO_TX2,
BTAUDIO_A2DP_SINK_TX,
BTFM_NUM_CODEC_DAIS
};

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023-2024 Qualcomm Innovation Center, Inc. All rights reserved.
*/
#include <linux/init.h>
@@ -137,12 +137,9 @@ static void btfm_swr_dai_shutdown(void *dai, int id)
case BTAUDIO_RX:
port_type = BT_AUDIO_RX1;
break;
case BTAUDIO_TX2:
case BTAUDIO_A2DP_SINK_TX:
port_type = BT_AUDIO_TX2;
break;
case BTAUDIO_RX2:
port_type = BT_AUDIO_RX2;
break;
case BTFM_NUM_CODEC_DAIS:
default:
BTFMSWR_ERR("dai->id is invalid:%d", id);
@@ -207,11 +204,6 @@ static int btfm_swr_dai_prepare(void *dai, uint32_t sampling_rate, uint32_t dire
bt_soc_enable_status = 0;
BTFMSWR_INFO("dai->id: %d, dai->rate: %d direction: %d", id, sampling_rate, direction);
if (btfmswr == NULL || btfmswr->p_dai_port == NULL) {
BTFMSWR_INFO("port open might have called without hw_init\n");
return -EINVAL;
}
btfm_get_sampling_rate(&sampling_rate);
btfmswr->sample_rate = sampling_rate;
@@ -225,12 +217,9 @@ static int btfm_swr_dai_prepare(void *dai, uint32_t sampling_rate, uint32_t dire
case BTAUDIO_RX:
port_type = BT_AUDIO_RX1;
break;
case BTAUDIO_TX2:
case BTAUDIO_A2DP_SINK_TX:
port_type = BT_AUDIO_TX2;
break;
case BTAUDIO_RX2:
port_type = BT_AUDIO_RX2;
break;
case BTFM_NUM_CODEC_DAIS:
default:
BTFMSWR_ERR("dai->id is invalid:%d", id);
@@ -277,12 +266,11 @@ static int btfm_swr_dai_get_channel_map(void *dai,
switch (id) {
case FMAUDIO_TX:
case BTAUDIO_TX:
case BTAUDIO_TX2:
case BTAUDIO_A2DP_SINK_TX:
*tx_num = btfmswr->num_channels;
*tx_slot = btfmswr->num_channels == 2 ? TWO_CHANNEL_MASK : ONE_CHANNEL_MASK;
break;
case BTAUDIO_RX:
case BTAUDIO_RX2:
*rx_num = btfmswr->num_channels;
*rx_slot = btfmswr->num_channels == 2 ? TWO_CHANNEL_MASK : ONE_CHANNEL_MASK;
break;
@@ -301,7 +289,7 @@ int btfm_swr_dai_get_configs(void *dai, void *config, uint8_t id)
struct btfmswr *btfmswr = dev_get_drvdata(hwep_info->dev);
struct hwep_dma_configurations *hwep_config;
BTFMSWR_INFO("DAI id %u", id);
BTFMSWR_DBG("");
hwep_config = (struct hwep_dma_configurations *)config;
hwep_config->stream_id = id;
@@ -313,14 +301,7 @@ int btfm_swr_dai_get_configs(void *dai, void *config, uint8_t id)
hwep_config->active_channel_mask = (btfmswr->num_channels == 2 ?
TWO_CHANNEL_MASK : ONE_CHANNEL_MASK);
hwep_config->lpaif = LPAIF_AUD;
if (id == BTAUDIO_RX2 || id == BTAUDIO_TX2) {
BTFMSWR_INFO("using interface index 2 for DAI id %u", id);
hwep_config->inf_index = 2;
} else {
BTFMSWR_INFO("using interface index 1 for DAI id %u", id);
hwep_config->inf_index = 1;
}
hwep_config->inf_index = 1;
return 1;
}
@@ -388,14 +369,13 @@ static struct hwep_dai_driver btfmswr_dai_driver[] = {
},
.dai_ops = &btfmswr_hw_dai_ops,
},
{ /* Bluetooth A2DP sink, HFP client: bt -> lpass */
.dai_name = "btaudio_tx2",
.id = BTAUDIO_TX2,
{ /* Bluetooth A2DP sink: bt -> lpass */
.dai_name = "btfm_a2dp_sink_swr_tx",
.id = BTAUDIO_A2DP_SINK_TX,
.capture = {
.stream_name = "BT Audio SWR Tx2 Capture",
.stream_name = "A2DP sink TX Capture",
/* 8/16/44.1/48/88.2/96/192 Khz */
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000
| SNDRV_PCM_RATE_8000_192000
| SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000
| SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000
| SNDRV_PCM_RATE_192000,
@@ -406,26 +386,7 @@ static struct hwep_dai_driver btfmswr_dai_driver[] = {
.channels_max = 1,
},
.dai_ops = &btfmswr_hw_dai_ops,
},
{ /* Bluetooth audio downlink2: lpass -> bt */
.dai_name = "btaudio_rx2",
.id = BTAUDIO_RX2,
.playback = {
.stream_name = "BT Audio SWR Rx2 Playback",
/* 8/16/44.1/48/88.2/96 Khz */
.rates = SNDRV_PCM_RATE_8000 | SNDRV_PCM_RATE_16000
| SNDRV_PCM_RATE_8000_192000
| SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000
| SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000
| SNDRV_PCM_RATE_192000,
.formats = SNDRV_PCM_FMTBIT_S16_LE, /* 16 bits */
.rate_max = 192000,
.rate_min = 8000,
.channels_min = 1,
.channels_max = 1,
},
.dai_ops = &btfmswr_hw_dai_ops,
},
}
};
static struct hwep_comp_drv btfmswr_hw_driver = {
@@ -456,7 +417,7 @@ int btfm_swr_register_hw_ep(struct btfmswr *btfm_swr)
hwep_info->drv = &btfmswr_hw_driver;
hwep_info->dai_drv = btfmswr_dai_driver;
hwep_info->num_dai = ARRAY_SIZE(btfmswr_dai_driver);
BTFMSWR_INFO("num_dai is: %lu", ARRAY_SIZE(btfmswr_dai_driver));
hwep_info->num_dai = 4;
hwep_info->num_mixer_ctrl = ARRAY_SIZE(status_controls);
hwep_info->mixer_ctrl = status_controls;
/* Register to hardware endpoint */

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
@@ -11,40 +11,34 @@ struct soc_port_mapping slave_port[] = {
// Evros
{
.ea = EVROS_EA,
.port_info[FMAUDIO_TX].dai_id = FMAUDIO_TX,
.port_info[FMAUDIO_TX].port = 5,
.port_info[0].dai_id = FMAUDIO_TX,
.port_info[0].port = 5,
.port_info[BTAUDIO_TX].dai_id = BTAUDIO_TX,
.port_info[BTAUDIO_TX].port = 3,
.port_info[1].dai_id = BTAUDIO_TX,
.port_info[1].port = 3,
.port_info[BTAUDIO_RX].dai_id = BTAUDIO_RX,
.port_info[BTAUDIO_RX].port = 1,
.port_info[2].dai_id = BTAUDIO_RX,
.port_info[2].port = 1,
.port_info[BTAUDIO_RX2].dai_id = BTAUDIO_RX2,
.port_info[BTAUDIO_RX2].port = 2,
.port_info[BTAUDIO_TX2].dai_id = BTAUDIO_TX2,
.port_info[BTAUDIO_TX2].port = 4,
.port_info[3].dai_id = BTAUDIO_A2DP_SINK_TX,
.port_info[3].port = 4,
},
// Ganges
{
.ea = GANGES_EA,
// FM is not supported on Ganges. populate with invalid port number
.port_info[FMAUDIO_TX].dai_id = FMAUDIO_TX,
.port_info[FMAUDIO_TX].port = BTFM_INVALID_PORT,
.port_info[0].dai_id = FMAUDIO_TX,
.port_info[0].port = BTFM_INVALID_PORT,
.port_info[BTAUDIO_TX].dai_id = BTAUDIO_TX,
.port_info[BTAUDIO_TX].port = 4,
.port_info[1].dai_id = BTAUDIO_TX,
.port_info[1].port = 4,
.port_info[BTAUDIO_RX].dai_id = BTAUDIO_RX,
.port_info[BTAUDIO_RX].port = 1,
.port_info[2].dai_id = BTAUDIO_RX,
.port_info[2].port = 1,
.port_info[BTAUDIO_RX2].dai_id = BTAUDIO_RX2,
.port_info[BTAUDIO_RX2].port = 2,
.port_info[BTAUDIO_TX2].dai_id = BTAUDIO_TX2,
.port_info[BTAUDIO_TX2].port = 5,
.port_info[3].dai_id = BTAUDIO_A2DP_SINK_TX,
.port_info[3].port = 5,
},
};

View File

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2023-2025 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
*/
@@ -33,13 +33,6 @@ enum {
QCA_EVROS_SOC_ID_0200 = 0x40200200,
};
enum {
QCA_ORNE_SOC_ID_0100 = 0x40262100,
};
enum {
QCA_COLOGNE_SOC_ID_0100 = 0x40292100,
};
enum {
EVROS_EA = 0x0108170220,