Skip to content

Commit

Permalink
Add support for TPS546D24S DEVICE_ID (#355)
Browse files Browse the repository at this point in the history
TPS546D24S is a drop in replacement for the TPS546D24A, but it has a different DEVICE_ID we need to check for.
  • Loading branch information
adasauce authored Sep 27, 2024
1 parent 68235d2 commit b817e30
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions main/TPS546.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@

static const char *TAG = "TPS546.c";

static uint8_t DEVICE_ID1[] = {0x54, 0x49, 0x54, 0x6B, 0x24, 0x41};
static uint8_t DEVICE_ID2[] = {0x54, 0x49, 0x54, 0x6D, 0x24, 0x41};
static uint8_t DEVICE_ID1[] = {0x54, 0x49, 0x54, 0x6B, 0x24, 0x41}; // TPS546D24A
static uint8_t DEVICE_ID2[] = {0x54, 0x49, 0x54, 0x6D, 0x24, 0x41}; // TPS546D24A
static uint8_t DEVICE_ID3[] = {0x54, 0x49, 0x54, 0x6D, 0x24, 0x62}; // TPS546D24S
static uint8_t MFR_ID[] = {'B', 'A', 'X'};
static uint8_t MFR_MODEL[] = {'H', 'E', 'X'};
static uint8_t MFR_REVISION[] = {0x00, 0x00, 0x01};
Expand Down Expand Up @@ -374,8 +375,8 @@ int TPS546_init(void)
smb_read_block(PMBUS_IC_DEVICE_ID, data, 6);
ESP_LOGI(TAG, "Device ID: %02x %02x %02x %02x %02x %02x", data[0], data[1],
data[2], data[3], data[4], data[5]);
/* There's two different known device IDs observed so far */
if ( (memcmp(data, DEVICE_ID1, 6) != 0) && (memcmp(data, DEVICE_ID2, 6) != 0) )
/* There's 3 different known device IDs observed so far */
if ( (memcmp(data, DEVICE_ID1, 6) != 0) && (memcmp(data, DEVICE_ID2, 6) != 0) && (memcmp(data, DEVICE_ID3, 6) != 0))
{
ESP_LOGI(TAG, "ERROR- cannot find TPS546 regulator");
return -1;
Expand Down

0 comments on commit b817e30

Please sign in to comment.