Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

USB: typec: tps6598x: Add TPS25750 support

TPS25750 controller requires a binary to be loaded with a configuration
binary by an EEPROM or a host.

Appling a patch bundling using a host is implemented based on the flow
diagram pg.62 in TPS25750 host interface manual.
https://www.ti.com/lit/ug/slvuc05a/slvuc05a.pdf

The flow diagram can be summarized as following:
- Start the patch loading sequence with patch bundle information by
executing PBMs
- Write the whole patch at once
- When writing the patch fails, execute PBMe which instructs the PD controller
to end the patching process
- After writing the patch successfully, execute PBMc which verifies the patch
integrity and applies the patch internally
- Wait for the device to switch into APP mode (normal operation)

The execuation flow diagram polls the events register and then polls the
corresponding register related to the event as well before advancing to the next
state. Polling the events register is a redundant step, in this implementation
only the corresponding register related to the event is polled.

Adding tps25750 support, the followings are being taken care of:
- Implement applying patch flow.
- When an EEPROM is present, tps25750 loads the binary configuration from
EEPROM. Hence, all we need to do is wait for the device to switch to APP
mode.
- Dead battery flag is cleared after switching tps25750 to APP mode so the
PD controller becomes fully functional.
- Add port registration as tps25750 doesn't have system configuration register
to get dr/pr of the current applied binary configuration. Get data role from
the device node and power role from PD status register.
- tps25750 event registers structure is different than tps6598x's,
tps25750 has 11 bytes of events which are read at once where
tps6598x has two event registers of 8 bytes each which are read
separately. Likewise MASK event registers. Also, not all events
are supported in both devices. Create a new handler to accommodate
tps25750 interrupt.
- Enable sleep mode so the device enters sleep state when idling.
- When the current mode is PTCH, enable tps25750 by loading a
configuration patch that switches the device into APP mode.
- Add resume and suspend pm for tps25750.

Signed-off-by: Abdel Alkuor <abdelalkuor@geotab.com>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Link: https://lore.kernel.org/r/20231003155842.57313-7-alkuor@gmail.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Abdel Alkuor and committed by
Greg Kroah-Hartman
7e7a3c81 5bd4853d

+456 -8
+439 -8
drivers/usb/typec/tipd/core.c
··· 17 17 #include <linux/usb/typec_altmode.h> 18 18 #include <linux/usb/role.h> 19 19 #include <linux/workqueue.h> 20 + #include <linux/firmware.h> 20 21 21 22 #include "tps6598x.h" 22 23 #include "trace.h" ··· 37 36 #define TPS_REG_STATUS 0x1a 38 37 #define TPS_REG_SYSTEM_CONF 0x28 39 38 #define TPS_REG_CTRL_CONF 0x29 39 + #define TPS_REG_BOOT_STATUS 0x2D 40 40 #define TPS_REG_POWER_STATUS 0x3f 41 + #define TPS_REG_PD_STATUS 0x40 41 42 #define TPS_REG_RX_IDENTITY_SOP 0x48 42 43 #define TPS_REG_DATA_STATUS 0x5f 44 + #define TPS_REG_SLEEP_CONF 0x70 43 45 44 46 /* TPS_REG_SYSTEM_CONF bits */ 45 47 #define TPS_SYSCONF_PORTINFO(c) ((c) & 7) 48 + 49 + /* 50 + * BPMs task timeout, recommended 5 seconds 51 + * pg.48 TPS2575 Host Interface Technical Reference 52 + * Manual (Rev. A) 53 + * https://www.ti.com/lit/ug/slvuc05a/slvuc05a.pdf 54 + */ 55 + #define TPS_BUNDLE_TIMEOUT 0x32 56 + 57 + /* BPMs return code */ 58 + #define TPS_TASK_BPMS_INVALID_BUNDLE_SIZE 0x4 59 + #define TPS_TASK_BPMS_INVALID_SLAVE_ADDR 0x5 60 + #define TPS_TASK_BPMS_INVALID_TIMEOUT 0x6 61 + 62 + /* PBMc data out */ 63 + #define TPS_PBMC_RC 0 /* Return code */ 64 + #define TPS_PBMC_DPCS 2 /* device patch complete status */ 46 65 47 66 enum { 48 67 TPS_PORTINFO_SINK, ··· 110 89 int (*register_port)(struct tps6598x *tps, struct fwnode_handle *node); 111 90 void (*trace_power_status)(u16 status); 112 91 void (*trace_status)(u32 status); 92 + int (*apply_patch)(struct tps6598x *tps); 113 93 }; 114 94 115 95 struct tps6598x { ··· 130 108 enum power_supply_usb_type usb_type; 131 109 132 110 int wakeup; 111 + u32 status; /* status reg */ 133 112 u16 pwr_status; 134 113 struct delayed_work wq_poll; 135 114 ··· 213 190 static inline int tps6598x_read64(struct tps6598x *tps, u8 reg, u64 *val) 214 191 { 215 192 return tps6598x_block_read(tps, reg, val, sizeof(u64)); 193 + } 194 + 195 + static inline int tps6598x_write8(struct tps6598x *tps, u8 reg, u8 val) 196 + { 197 + return tps6598x_block_write(tps, reg, &val, sizeof(u8)); 216 198 } 217 199 218 200 static inline int tps6598x_write64(struct tps6598x *tps, u8 reg, u64 val) ··· 568 540 return IRQ_NONE; 569 541 } 570 542 543 + static bool tps6598x_has_role_changed(struct tps6598x *tps, u32 status) 544 + { 545 + status ^= tps->status; 546 + 547 + return status & (TPS_STATUS_PORTROLE | TPS_STATUS_DATAROLE); 548 + } 549 + 550 + static irqreturn_t tps25750_interrupt(int irq, void *data) 551 + { 552 + struct tps6598x *tps = data; 553 + u64 event[2] = { }; 554 + u32 status; 555 + int ret; 556 + 557 + mutex_lock(&tps->lock); 558 + 559 + ret = tps6598x_block_read(tps, TPS_REG_INT_EVENT1, event, 11); 560 + if (ret) { 561 + dev_err(tps->dev, "%s: failed to read events\n", __func__); 562 + goto err_unlock; 563 + } 564 + 565 + if (!(event[0] | event[1])) 566 + goto err_unlock; 567 + 568 + if (!tps6598x_read_status(tps, &status)) 569 + goto err_clear_ints; 570 + 571 + if ((event[0] | event[1]) & TPS_REG_INT_POWER_STATUS_UPDATE) 572 + if (!tps6598x_read_power_status(tps)) 573 + goto err_clear_ints; 574 + 575 + if ((event[0] | event[1]) & TPS_REG_INT_DATA_STATUS_UPDATE) 576 + if (!tps6598x_read_data_status(tps)) 577 + goto err_clear_ints; 578 + 579 + /* 580 + * data/port roles could be updated independently after 581 + * a plug event. Therefore, we need to check 582 + * for pr/dr status change to set TypeC dr/pr accordingly. 583 + */ 584 + if ((event[0] | event[1]) & TPS_REG_INT_PLUG_EVENT || 585 + tps6598x_has_role_changed(tps, status)) 586 + tps6598x_handle_plug_event(tps, status); 587 + 588 + tps->status = status; 589 + 590 + err_clear_ints: 591 + tps6598x_block_write(tps, TPS_REG_INT_CLEAR1, event, 11); 592 + 593 + err_unlock: 594 + mutex_unlock(&tps->lock); 595 + 596 + if (event[0] | event[1]) 597 + return IRQ_HANDLED; 598 + return IRQ_NONE; 599 + } 600 + 571 601 static irqreturn_t tps6598x_interrupt(int irq, void *data) 572 602 { 573 603 struct tps6598x *tps = data; ··· 695 609 if (ret) 696 610 return ret; 697 611 698 - switch (match_string(modes, ARRAY_SIZE(modes), mode)) { 612 + ret = match_string(modes, ARRAY_SIZE(modes), mode); 613 + 614 + switch (ret) { 699 615 case TPS_MODE_APP: 700 616 case TPS_MODE_PTCH: 701 - return 0; 617 + return ret; 702 618 case TPS_MODE_BOOT: 703 619 dev_warn(tps->dev, "dead-battery condition\n"); 704 - return 0; 620 + return ret; 705 621 case TPS_MODE_BIST: 706 622 case TPS_MODE_DISC: 707 623 default: ··· 865 777 return 0; 866 778 } 867 779 780 + static int 781 + tps25750_write_firmware(struct tps6598x *tps, 782 + u8 bpms_addr, const u8 *data, size_t len) 783 + { 784 + struct i2c_client *client = to_i2c_client(tps->dev); 785 + int ret; 786 + u8 slave_addr; 787 + int timeout; 788 + 789 + slave_addr = client->addr; 790 + timeout = client->adapter->timeout; 791 + 792 + /* 793 + * binary configuration size is around ~16Kbytes 794 + * which might take some time to finish writing it 795 + */ 796 + client->adapter->timeout = msecs_to_jiffies(5000); 797 + client->addr = bpms_addr; 798 + 799 + ret = regmap_raw_write(tps->regmap, data[0], &data[1], len - 1); 800 + 801 + client->addr = slave_addr; 802 + client->adapter->timeout = timeout; 803 + 804 + return ret; 805 + } 806 + 807 + static int 808 + tps25750_exec_pbms(struct tps6598x *tps, u8 *in_data, size_t in_len) 809 + { 810 + int ret; 811 + u8 rc; 812 + 813 + ret = tps6598x_exec_cmd_tmo(tps, "PBMs", in_len, in_data, 814 + sizeof(rc), &rc, 4000, 0); 815 + if (ret) 816 + return ret; 817 + 818 + switch (rc) { 819 + case TPS_TASK_BPMS_INVALID_BUNDLE_SIZE: 820 + dev_err(tps->dev, "%s: invalid fw size\n", __func__); 821 + return -EINVAL; 822 + case TPS_TASK_BPMS_INVALID_SLAVE_ADDR: 823 + dev_err(tps->dev, "%s: invalid slave address\n", __func__); 824 + return -EINVAL; 825 + case TPS_TASK_BPMS_INVALID_TIMEOUT: 826 + dev_err(tps->dev, "%s: timed out\n", __func__); 827 + return -ETIMEDOUT; 828 + default: 829 + break; 830 + } 831 + 832 + return 0; 833 + } 834 + 835 + static int tps25750_abort_patch_process(struct tps6598x *tps) 836 + { 837 + int ret; 838 + 839 + ret = tps6598x_exec_cmd(tps, "PBMe", 0, NULL, 0, NULL); 840 + if (ret) 841 + return ret; 842 + 843 + ret = tps6598x_check_mode(tps); 844 + if (ret != TPS_MODE_PTCH) 845 + dev_err(tps->dev, "failed to switch to \"PTCH\" mode\n"); 846 + 847 + return ret; 848 + } 849 + 850 + static int tps25750_start_patch_burst_mode(struct tps6598x *tps) 851 + { 852 + int ret; 853 + const struct firmware *fw; 854 + const char *firmware_name; 855 + struct { 856 + u32 fw_size; 857 + u8 addr; 858 + u8 timeout; 859 + } __packed bpms_data; 860 + u32 addr; 861 + struct device_node *np = tps->dev->of_node; 862 + 863 + ret = device_property_read_string(tps->dev, "firmware-name", 864 + &firmware_name); 865 + if (ret) 866 + return ret; 867 + 868 + ret = request_firmware(&fw, firmware_name, tps->dev); 869 + if (ret) { 870 + dev_err(tps->dev, "failed to retrieve \"%s\"\n", firmware_name); 871 + return ret; 872 + } 873 + 874 + if (fw->size == 0) { 875 + ret = -EINVAL; 876 + goto release_fw; 877 + } 878 + 879 + ret = of_property_match_string(np, "reg-names", "patch-address"); 880 + if (ret < 0) { 881 + dev_err(tps->dev, "failed to get patch-address %d\n", ret); 882 + return ret; 883 + } 884 + 885 + ret = of_property_read_u32_index(np, "reg", ret, &addr); 886 + if (ret) 887 + return ret; 888 + 889 + if (addr == 0 || (addr >= 0x20 && addr <= 0x23)) { 890 + dev_err(tps->dev, "wrong patch address %u\n", addr); 891 + return -EINVAL; 892 + } 893 + 894 + bpms_data.addr = (u8)addr; 895 + bpms_data.fw_size = fw->size; 896 + bpms_data.timeout = TPS_BUNDLE_TIMEOUT; 897 + 898 + ret = tps25750_exec_pbms(tps, (u8 *)&bpms_data, sizeof(bpms_data)); 899 + if (ret) 900 + goto release_fw; 901 + 902 + ret = tps25750_write_firmware(tps, bpms_data.addr, fw->data, fw->size); 903 + if (ret) { 904 + dev_err(tps->dev, "Failed to write patch %s of %zu bytes\n", 905 + firmware_name, fw->size); 906 + goto release_fw; 907 + } 908 + 909 + /* 910 + * A delay of 500us is required after the firmware is written 911 + * based on pg.62 in tps6598x Host Interface Technical 912 + * Reference Manual 913 + * https://www.ti.com/lit/ug/slvuc05a/slvuc05a.pdf 914 + */ 915 + udelay(500); 916 + 917 + release_fw: 918 + release_firmware(fw); 919 + 920 + return ret; 921 + } 922 + 923 + static int tps25750_complete_patch_process(struct tps6598x *tps) 924 + { 925 + int ret; 926 + u8 out_data[40]; 927 + u8 dummy[2] = { }; 928 + 929 + /* 930 + * Without writing something to DATA_IN, this command would 931 + * return an error 932 + */ 933 + ret = tps6598x_exec_cmd_tmo(tps, "PBMc", sizeof(dummy), dummy, 934 + sizeof(out_data), out_data, 2000, 20); 935 + if (ret) 936 + return ret; 937 + 938 + if (out_data[TPS_PBMC_RC]) { 939 + dev_err(tps->dev, 940 + "%s: pbmc failed: %u\n", __func__, 941 + out_data[TPS_PBMC_RC]); 942 + return -EIO; 943 + } 944 + 945 + if (out_data[TPS_PBMC_DPCS]) { 946 + dev_err(tps->dev, 947 + "%s: failed device patch complete status: %u\n", 948 + __func__, out_data[TPS_PBMC_DPCS]); 949 + return -EIO; 950 + } 951 + 952 + return 0; 953 + } 954 + 955 + static int tps25750_apply_patch(struct tps6598x *tps) 956 + { 957 + int ret; 958 + unsigned long timeout; 959 + u64 status = 0; 960 + 961 + ret = tps6598x_block_read(tps, TPS_REG_BOOT_STATUS, &status, 5); 962 + if (ret) 963 + return ret; 964 + /* 965 + * Nothing to be done if the configuration 966 + * is being loaded from EERPOM 967 + */ 968 + if (status & TPS_BOOT_STATUS_I2C_EEPROM_PRESENT) 969 + goto wait_for_app; 970 + 971 + ret = tps25750_start_patch_burst_mode(tps); 972 + if (ret) { 973 + tps25750_abort_patch_process(tps); 974 + return ret; 975 + } 976 + 977 + ret = tps25750_complete_patch_process(tps); 978 + if (ret) 979 + return ret; 980 + 981 + wait_for_app: 982 + timeout = jiffies + msecs_to_jiffies(1000); 983 + 984 + do { 985 + ret = tps6598x_check_mode(tps); 986 + if (ret < 0) 987 + return ret; 988 + 989 + if (time_is_before_jiffies(timeout)) 990 + return -ETIMEDOUT; 991 + 992 + } while (ret != TPS_MODE_APP); 993 + 994 + /* 995 + * The dead battery flag may be triggered when the controller 996 + * port is connected to a device that can source power and 997 + * attempts to power up both the controller and the board it is on. 998 + * To restore controller functionality, it is necessary to clear 999 + * this flag 1000 + */ 1001 + if (status & TPS_BOOT_STATUS_DEAD_BATTERY_FLAG) { 1002 + ret = tps6598x_exec_cmd(tps, "DBfg", 0, NULL, 0, NULL); 1003 + if (ret) { 1004 + dev_err(tps->dev, "failed to clear dead battery %d\n", ret); 1005 + return ret; 1006 + } 1007 + } 1008 + 1009 + dev_info(tps->dev, "controller switched to \"APP\" mode\n"); 1010 + 1011 + return 0; 1012 + }; 1013 + 1014 + static int tps25750_init(struct tps6598x *tps) 1015 + { 1016 + int ret; 1017 + 1018 + ret = tps->data->apply_patch(tps); 1019 + if (ret) 1020 + return ret; 1021 + 1022 + ret = tps6598x_write8(tps, TPS_REG_SLEEP_CONF, 1023 + TPS_SLEEP_CONF_SLEEP_MODE_ALLOWED); 1024 + if (ret) 1025 + dev_warn(tps->dev, 1026 + "%s: failed to enable sleep mode: %d\n", 1027 + __func__, ret); 1028 + 1029 + return 0; 1030 + } 1031 + 1032 + static int 1033 + tps25750_register_port(struct tps6598x *tps, struct fwnode_handle *fwnode) 1034 + { 1035 + struct typec_capability typec_cap = { }; 1036 + const char *data_role; 1037 + u8 pd_status; 1038 + int ret; 1039 + 1040 + ret = tps6598x_read8(tps, TPS_REG_PD_STATUS, &pd_status); 1041 + if (ret) 1042 + return ret; 1043 + 1044 + ret = fwnode_property_read_string(fwnode, "data-role", &data_role); 1045 + if (ret) { 1046 + dev_err(tps->dev, "data-role not found: %d\n", ret); 1047 + return ret; 1048 + } 1049 + 1050 + ret = typec_find_port_data_role(data_role); 1051 + if (ret < 0) { 1052 + dev_err(tps->dev, "unknown data-role: %s\n", data_role); 1053 + return ret; 1054 + } 1055 + 1056 + typec_cap.data = ret; 1057 + typec_cap.revision = USB_TYPEC_REV_1_3; 1058 + typec_cap.pd_revision = 0x300; 1059 + typec_cap.driver_data = tps; 1060 + typec_cap.ops = &tps6598x_ops; 1061 + typec_cap.fwnode = fwnode; 1062 + typec_cap.prefer_role = TYPEC_NO_PREFERRED_ROLE; 1063 + 1064 + switch (TPS_PD_STATUS_PORT_TYPE(pd_status)) { 1065 + case TPS_PD_STATUS_PORT_TYPE_SINK_SOURCE: 1066 + case TPS_PD_STATUS_PORT_TYPE_SOURCE_SINK: 1067 + typec_cap.type = TYPEC_PORT_DRP; 1068 + break; 1069 + case TPS_PD_STATUS_PORT_TYPE_SINK: 1070 + typec_cap.type = TYPEC_PORT_SNK; 1071 + break; 1072 + case TPS_PD_STATUS_PORT_TYPE_SOURCE: 1073 + typec_cap.type = TYPEC_PORT_SRC; 1074 + break; 1075 + default: 1076 + return -ENODEV; 1077 + } 1078 + 1079 + tps->port = typec_register_port(tps->dev, &typec_cap); 1080 + if (IS_ERR(tps->port)) 1081 + return PTR_ERR(tps->port); 1082 + 1083 + return 0; 1084 + } 1085 + 868 1086 static int tps6598x_probe(struct i2c_client *client) 869 1087 { 870 1088 struct device_node *np = client->dev.of_node; ··· 1180 786 u32 vid; 1181 787 int ret; 1182 788 u64 mask1; 789 + bool is_tps25750; 1183 790 1184 791 tps = devm_kzalloc(&client->dev, sizeof(*tps), GFP_KERNEL); 1185 792 if (!tps) ··· 1193 798 if (IS_ERR(tps->regmap)) 1194 799 return PTR_ERR(tps->regmap); 1195 800 1196 - ret = tps6598x_read32(tps, TPS_REG_VID, &vid); 1197 - if (ret < 0 || !vid) 1198 - return -ENODEV; 801 + is_tps25750 = device_is_compatible(tps->dev, "ti,tps25750"); 802 + if (!is_tps25750) { 803 + ret = tps6598x_read32(tps, TPS_REG_VID, &vid); 804 + if (ret < 0 || !vid) 805 + return -ENODEV; 806 + } 1199 807 1200 808 /* 1201 809 * Checking can the adapter handle SMBus protocol. If it can not, the ··· 1231 833 1232 834 /* Make sure the controller has application firmware running */ 1233 835 ret = tps6598x_check_mode(tps); 1234 - if (ret) 836 + if (ret < 0) 1235 837 return ret; 838 + 839 + if (is_tps25750 && ret == TPS_MODE_PTCH) { 840 + ret = tps25750_init(tps); 841 + if (ret) 842 + return ret; 843 + } 1236 844 1237 845 ret = tps6598x_write64(tps, TPS_REG_INT_MASK1, mask1); 1238 846 if (ret) 1239 - return ret; 847 + goto err_reset_controller; 1240 848 1241 849 if (!tps6598x_read_status(tps, &status)) { 1242 850 ret = -ENODEV; ··· 1321 917 fwnode_handle_put(fwnode); 1322 918 err_clear_mask: 1323 919 tps6598x_write64(tps, TPS_REG_INT_MASK1, 0); 920 + err_reset_controller: 921 + /* Reset PD controller to remove any applied patch */ 922 + if (is_tps25750) 923 + tps6598x_exec_cmd_tmo(tps, "GAID", 0, NULL, 0, NULL, 2000, 0); 1324 924 return ret; 1325 925 } 1326 926 ··· 1335 927 if (!client->irq) 1336 928 cancel_delayed_work_sync(&tps->wq_poll); 1337 929 930 + devm_free_irq(tps->dev, client->irq, tps); 1338 931 tps6598x_disconnect(tps, 0); 1339 932 typec_unregister_port(tps->port); 1340 933 usb_role_switch_put(tps->role_sw); 934 + 935 + /* Reset PD controller to remove any applied patch */ 936 + if (device_is_compatible(tps->dev, "ti,tps25750")) 937 + tps6598x_exec_cmd_tmo(tps, "GAID", 0, NULL, 0, NULL, 2000, 0); 1341 938 } 1342 939 1343 940 static int __maybe_unused tps6598x_suspend(struct device *dev) ··· 1365 952 { 1366 953 struct i2c_client *client = to_i2c_client(dev); 1367 954 struct tps6598x *tps = i2c_get_clientdata(client); 955 + int ret; 956 + 957 + ret = tps6598x_check_mode(tps); 958 + if (ret < 0) 959 + return ret; 960 + 961 + if (device_is_compatible(tps->dev, "ti,tps25750") && ret == TPS_MODE_PTCH) { 962 + ret = tps25750_init(tps); 963 + if (ret) 964 + return ret; 965 + } 1368 966 1369 967 if (tps->wakeup) { 1370 968 disable_irq_wake(client->irq); ··· 1407 983 .trace_status = trace_tps6598x_status, 1408 984 }; 1409 985 986 + static const struct tipd_data tps25750_data = { 987 + .irq_handler = tps25750_interrupt, 988 + .register_port = tps25750_register_port, 989 + .apply_patch = tps25750_apply_patch, 990 + }; 991 + 1410 992 static const struct of_device_id tps6598x_of_match[] = { 1411 993 { .compatible = "ti,tps6598x", &tps6598x_data}, 1412 994 { .compatible = "apple,cd321x", &cd321x_data}, 995 + { .compatible = "ti,tps25750", &tps25750_data}, 1413 996 {} 1414 997 }; 1415 998 MODULE_DEVICE_TABLE(of, tps6598x_of_match);
+17
drivers/usb/typec/tipd/tps6598x.h
··· 199 199 #define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_A BIT(2) 200 200 #define TPS_DATA_STATUS_DP_SPEC_PIN_ASSIGNMENT_B (BIT(2) | BIT(1)) 201 201 202 + /* BOOT STATUS REG*/ 203 + #define TPS_BOOT_STATUS_DEAD_BATTERY_FLAG BIT(2) 204 + #define TPS_BOOT_STATUS_I2C_EEPROM_PRESENT BIT(3) 205 + 206 + /* PD STATUS REG */ 207 + #define TPS_REG_PD_STATUS_PORT_TYPE_MASK GENMASK(5, 4) 208 + #define TPS_PD_STATUS_PORT_TYPE(x) \ 209 + TPS_FIELD_GET(TPS_REG_PD_STATUS_PORT_TYPE_MASK, x) 210 + 211 + #define TPS_PD_STATUS_PORT_TYPE_SINK_SOURCE 0 212 + #define TPS_PD_STATUS_PORT_TYPE_SINK 1 213 + #define TPS_PD_STATUS_PORT_TYPE_SOURCE 2 214 + #define TPS_PD_STATUS_PORT_TYPE_SOURCE_SINK 3 215 + 216 + /* SLEEP CONF REG */ 217 + #define TPS_SLEEP_CONF_SLEEP_MODE_ALLOWED BIT(0) 218 + 202 219 #endif /* __TPS6598X_H__ */