Skip to content

Commit

Permalink
Bluetooth: btqca: Rename ROME specific variables to generic variables
Browse files Browse the repository at this point in the history
Variables which are named with rome are commonly used for all the
BT SoC's. Instead of continuing further, renamed them to generic
name.

Signed-off-by: Balakrishna Godavarthi <bgodavar@codeaurora.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Balakrishna Godavarthi authored and Marcel Holtmann committed Nov 9, 2019
1 parent 53121a7 commit e303d12
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 25 deletions.
28 changes: 14 additions & 14 deletions drivers/bluetooth/btqca.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version)
{
struct sk_buff *skb;
struct edl_event_hdr *edl;
struct rome_version *ver;
struct qca_btsoc_version *ver;
char cmd;
int err = 0;

Expand Down Expand Up @@ -55,19 +55,19 @@ int qca_read_soc_version(struct hci_dev *hdev, u32 *soc_version)
goto out;
}

ver = (struct rome_version *)(edl->data);
ver = (struct qca_btsoc_version *)(edl->data);

BT_DBG("%s: Product:0x%08x", hdev->name, le32_to_cpu(ver->product_id));
BT_DBG("%s: Patch :0x%08x", hdev->name, le16_to_cpu(ver->patch_ver));
BT_DBG("%s: ROM :0x%08x", hdev->name, le16_to_cpu(ver->rome_ver));
BT_DBG("%s: ROM :0x%08x", hdev->name, le16_to_cpu(ver->rom_ver));
BT_DBG("%s: SOC :0x%08x", hdev->name, le32_to_cpu(ver->soc_id));

/* QCA chipset version can be decided by patch and SoC
* version, combination with upper 2 bytes from SoC
* and lower 2 bytes from patch will be used.
*/
*soc_version = (le32_to_cpu(ver->soc_id) << 16) |
(le16_to_cpu(ver->rome_ver) & 0x0000ffff);
(le16_to_cpu(ver->rom_ver) & 0x0000ffff);
if (*soc_version == 0)
err = -EILSEQ;

Expand Down Expand Up @@ -121,7 +121,7 @@ int qca_send_pre_shutdown_cmd(struct hci_dev *hdev)
}
EXPORT_SYMBOL_GPL(qca_send_pre_shutdown_cmd);

static void qca_tlv_check_data(struct rome_config *config,
static void qca_tlv_check_data(struct qca_fw_config *config,
const struct firmware *fw)
{
const u8 *data;
Expand All @@ -140,8 +140,8 @@ static void qca_tlv_check_data(struct rome_config *config,
BT_DBG("TLV Type\t\t : 0x%x", type_len & 0x000000ff);
BT_DBG("Length\t\t : %d bytes", length);

config->dnld_mode = ROME_SKIP_EVT_NONE;
config->dnld_type = ROME_SKIP_EVT_NONE;
config->dnld_mode = QCA_SKIP_EVT_NONE;
config->dnld_type = QCA_SKIP_EVT_NONE;

switch (config->type) {
case TLV_TYPE_PATCH:
Expand Down Expand Up @@ -223,7 +223,7 @@ static void qca_tlv_check_data(struct rome_config *config,
}

static int qca_tlv_send_segment(struct hci_dev *hdev, int seg_size,
const u8 *data, enum rome_tlv_dnld_mode mode)
const u8 *data, enum qca_tlv_dnld_mode mode)
{
struct sk_buff *skb;
struct edl_event_hdr *edl;
Expand All @@ -235,7 +235,7 @@ static int qca_tlv_send_segment(struct hci_dev *hdev, int seg_size,
cmd[1] = seg_size;
memcpy(cmd + 2, data, seg_size);

if (mode == ROME_SKIP_EVT_VSE_CC || mode == ROME_SKIP_EVT_VSE)
if (mode == QCA_SKIP_EVT_VSE_CC || mode == QCA_SKIP_EVT_VSE)
return __hci_cmd_send(hdev, EDL_PATCH_CMD_OPCODE, seg_size + 2,
cmd);

Expand Down Expand Up @@ -301,7 +301,7 @@ static int qca_inject_cmd_complete_event(struct hci_dev *hdev)
}

static int qca_download_firmware(struct hci_dev *hdev,
struct rome_config *config)
struct qca_fw_config *config)
{
const struct firmware *fw;
const u8 *segment;
Expand All @@ -328,7 +328,7 @@ static int qca_download_firmware(struct hci_dev *hdev,
remain -= segsize;
/* The last segment is always acked regardless download mode */
if (!remain || segsize < MAX_SIZE_PER_TLV_SEGMENT)
config->dnld_mode = ROME_SKIP_EVT_NONE;
config->dnld_mode = QCA_SKIP_EVT_NONE;

ret = qca_tlv_send_segment(hdev, segsize, segment,
config->dnld_mode);
Expand All @@ -344,8 +344,8 @@ static int qca_download_firmware(struct hci_dev *hdev,
* decrease the BT in initialization time. Here we will inject a command
* complete event to avoid a command timeout error message.
*/
if (config->dnld_type == ROME_SKIP_EVT_VSE_CC ||
config->dnld_type == ROME_SKIP_EVT_VSE)
if (config->dnld_type == QCA_SKIP_EVT_VSE_CC ||
config->dnld_type == QCA_SKIP_EVT_VSE)
ret = qca_inject_cmd_complete_event(hdev);

out:
Expand Down Expand Up @@ -382,7 +382,7 @@ int qca_uart_setup(struct hci_dev *hdev, uint8_t baudrate,
enum qca_btsoc_type soc_type, u32 soc_ver,
const char *firmware_name)
{
struct rome_config config;
struct qca_fw_config config;
int err;
u8 rom_ver = 0;

Expand Down
22 changes: 11 additions & 11 deletions drivers/bluetooth/btqca.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,24 +56,24 @@ enum qca_baudrate {
QCA_BAUDRATE_RESERVED
};

enum rome_tlv_dnld_mode {
ROME_SKIP_EVT_NONE,
ROME_SKIP_EVT_VSE,
ROME_SKIP_EVT_CC,
ROME_SKIP_EVT_VSE_CC
enum qca_tlv_dnld_mode {
QCA_SKIP_EVT_NONE,
QCA_SKIP_EVT_VSE,
QCA_SKIP_EVT_CC,
QCA_SKIP_EVT_VSE_CC
};

enum rome_tlv_type {
enum qca_tlv_type {
TLV_TYPE_PATCH = 1,
TLV_TYPE_NVM
};

struct rome_config {
struct qca_fw_config {
u8 type;
char fwname[64];
uint8_t user_baud_rate;
enum rome_tlv_dnld_mode dnld_mode;
enum rome_tlv_dnld_mode dnld_type;
enum qca_tlv_dnld_mode dnld_mode;
enum qca_tlv_dnld_mode dnld_type;
};

struct edl_event_hdr {
Expand All @@ -82,10 +82,10 @@ struct edl_event_hdr {
__u8 data[0];
} __packed;

struct rome_version {
struct qca_btsoc_version {
__le32 product_id;
__le16 patch_ver;
__le16 rome_ver;
__le16 rom_ver;
__le32 soc_id;
} __packed;

Expand Down

0 comments on commit e303d12

Please sign in to comment.