[prev in list] [next in list] [prev in thread] [next in thread] 

List:       libftdi
Subject:    [PATCH] ftdi_eeprom: Allow programming of the is_not_pnp value
From:       Dmitry Baryshkov <dmitry.baryshkov () linaro ! org>
Date:       2024-03-19 22:28:14
Message-ID: 20240319222814.1260271-1-dmitry.baryshkov () linaro ! org
[Download RAW message or body]

Allow users to set the is_not_pnp option in order to be 100% compatible
with the existing EEPROM files.

Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
---
 ftdi_eeprom/main.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/ftdi_eeprom/main.c b/ftdi_eeprom/main.c
index e3a09ba421fd..4582480082d3 100644
--- a/ftdi_eeprom/main.c
+++ b/ftdi_eeprom/main.c
@@ -279,6 +279,7 @@ int main(int argc, char *argv[])
         CFG_BOOL("chb_rs485", cfg_false, 0),
         CFG_BOOL("chc_rs485", cfg_false, 0),
         CFG_BOOL("chd_rs485", cfg_false, 0),
+        CFG_BOOL("is_not_pnp", cfg_false, 0),
         CFG_FUNC("include", &cfg_include),
         CFG_INT("user_data_addr", 0x18, 0),
         CFG_STR("user_data_file", "", 0),
@@ -540,6 +541,9 @@ int main(int argc, char *argv[])
     if (cfg_getbool(cfg, "invert_ri")) invert |= INVERT_RI;
     eeprom_set_value(ftdi, INVERT, invert);
 
+    if (ftdi->type > TYPE_BM && ftdi->type != TYPE_4232H)
+        if (cfg_getint(cfg, "is_not_pnp") != -1)
+            eeprom_set_value(ftdi, IS_NOT_PNP, cfg_getbool(cfg, "is_not_pnp"));
     if (cfg_getint(cfg, "cha_type") != -1)
         eeprom_set_value(ftdi, CHANNEL_A_TYPE, cfg_getint(cfg, "cha_type"));
     if (cfg_getint(cfg, "chb_type") != -1)
-- 
2.39.2


--
libftdi - see http://www.intra2net.com/en/developer/libftdi for details.
To unsubscribe send a mail to libftdi+unsubscribe@developer.intra2net.com   

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic