Skip to content

Commit

Permalink
fixup! drivers/fx5x06: fix vendor ID for FT6xx6
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Aug 9, 2023
1 parent 03bcdf6 commit 766f0f4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 12 deletions.
16 changes: 8 additions & 8 deletions drivers/ft5x06/ft5x06.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ int ft5x06_init(ft5x06_t *dev, const ft5x06_params_t *params, ft5x06_event_cb_t
return -EPROTO;
}

uint8_t expected_id;
if (dev->params.type == FT5X06_TYPE_FT6X06 || dev->params.type == FT5X06_TYPE_FT6X36) {
expected_id = FT6XX6_VENDOR_ID;
if ((vendor_id != FT5X06_VENDOR_ID_2) && (vendor_id != FT5X06_VENDOR_ID_3)) {
DEBUG("[ft5x06] init: invalid vendor ID: '0x%02x' (expected: 0x%02x or 0x%02x)\n",
vendor_id, FT5X06_VENDOR_ID_2, FT5X06_VENDOR_ID_3);
i2c_release(FT5X06_BUS);
return -ENODEV;
}
}
else {
expected_id = FT5X06_VENDOR_ID;
}

if (expected_id != vendor_id) {
else if (vendor_id != FT5X06_VENDOR_ID_1) {
DEBUG("[ft5x06] init: invalid vendor ID: '0x%02x' (expected: 0x%02x)\n",
vendor_id, expected_id);
vendor_id, FT5X06_VENDOR_ID_1);
i2c_release(FT5X06_BUS);
return -ENODEV;
}
Expand Down
13 changes: 9 additions & 4 deletions drivers/ft5x06/include/ft5x06_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,19 @@ extern "C" {
#define FT5X06_I2C_DEFAULT_ADDRESS (0x38)

/**
* @brief Vendor ID for FT6X06 and FT6X36 models.
* @brief Vendor ID for FT5606, FT5X16, FT5X06I, FT5336, FT3316, FT5436I, FT5336I, FT5X46 models.
*/
#define FT6XX6_VENDOR_ID (0x11)
#define FT5X06_VENDOR_ID_1 (0x51)

/**
* @brief Vendor ID for FT5606, FT5X16, FT5X06I, FT5336, FT3316, FT5436I, FT5336I, FT5X46 models.
* @brief Vendor ID used for most FT6X06 and FT6X36 as well as FT3X67 models.
*/
#define FT5X06_VENDOR_ID_2 (0x11)

/**
* @brief Vendor ID used for some FT6X06 and FT6X36 models.
*/
#define FT5X06_VENDOR_ID (0x51)
#define FT5X06_VENDOR_ID_3 (0xcd)

/**
* @brief Maximum touches count for FT6X06 and FT6X36 models.
Expand Down

0 comments on commit 766f0f4

Please sign in to comment.