summaryrefslogtreecommitdiff
path: root/halimpl
diff options
context:
space:
mode:
authorPaul Chaisson <chaisson@broadcom.com>2014-01-14 19:35:20 -0500
committerMartijn Coenen <maco@google.com>2014-02-27 21:27:52 +0000
commit75c48f079b2f77797c56e9662af1e569b872fb0c (patch)
treedb29ce6b9585faa45e9ce2b1597d33e8a39c05ba /halimpl
parentc546ae8a76130b9d6576f959123234b61c62ce8e (diff)
downloadlibnfc-nci-75c48f079b2f77797c56e9662af1e569b872fb0c.tar.gz
Add chip-id adjustment for 20795.
Change-Id: Ied6ec2f2d0d36bf573305ed9c4ab7a29cc0be237
Diffstat (limited to 'halimpl')
-rw-r--r--halimpl/bcm2079x/hal/hal/nfc_hal_dm.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/halimpl/bcm2079x/hal/hal/nfc_hal_dm.c b/halimpl/bcm2079x/hal/hal/nfc_hal_dm.c
index 0d0d15e..d7ba043 100644
--- a/halimpl/bcm2079x/hal/hal/nfc_hal_dm.c
+++ b/halimpl/bcm2079x/hal/hal/nfc_hal_dm.c
@@ -443,6 +443,22 @@ void nfc_hal_dm_send_get_build_info_cmd (void)
/* get build information to find out HW */
nfc_hal_dm_send_nci_cmd (nfc_hal_dm_get_build_info_cmd, NCI_MSG_HDR_SIZE, NULL);
}
+/*******************************************************************************
+**
+** Function: nfc_hal_dm_adjust_hw_id
+**
+** Description: The hw_id of certain chips are shifted by 8 bits.
+** Adjust the hw_id before processing.
+**
+** Returns: Nothing
+**
+*******************************************************************************/
+static UINT32 nfc_hal_dm_adjust_hw_id (UINT32 hw_id)
+{
+ if ((hw_id & 0xF0000000) == 0)
+ hw_id <<= 4; /* shift hw_id by 4 bits to align w the format of most chips */
+ return hw_id;
+}
/*******************************************************************************
**
@@ -464,6 +480,7 @@ void nfc_hal_dm_proc_msg_during_init (NFC_HDR *p_msg)
UINT8 chipverlen;
UINT8 chipverstr[NCI_SPD_HEADER_CHIPVER_LEN];
UINT16 xtal_freq;
+ UINT32 hw_id = 0;
HAL_TRACE_DEBUG1 ("nfc_hal_dm_proc_msg_during_init(): init state:%d", nfc_hal_cb.dev_cb.initializing_state);
@@ -550,7 +567,9 @@ void nfc_hal_dm_proc_msg_during_init (NFC_HDR *p_msg)
{
p += NCI_BUILD_INFO_OFFSET_HWID;
- STREAM_TO_UINT32 (nfc_hal_cb.dev_cb.brcm_hw_id, p);
+ STREAM_TO_UINT32 (hw_id, p);
+ nfc_hal_cb.dev_cb.brcm_hw_id = nfc_hal_dm_adjust_hw_id (hw_id);
+ HAL_TRACE_DEBUG2 ("brcm_hw_id: 0x%x -> 0x%x", hw_id, nfc_hal_cb.dev_cb.brcm_hw_id);
STREAM_TO_UINT8 (chipverlen, p);
memset (chipverstr, 0, NCI_SPD_HEADER_CHIPVER_LEN);