diff --git a/drivers/phy/apple/atc-test.c b/drivers/phy/apple/atc-test.c index 2bbe0b34e5c1a..6df38318c01cb 100644 --- a/drivers/phy/apple/atc-test.c +++ b/drivers/phy/apple/atc-test.c @@ -1740,39 +1740,14 @@ static void atcphy_test_t6030_restore_dp_mode_fail(struct kunit *test) KUNIT_EXPECT_FALSE(test, atcphy->pd_state_forgotten); } -static void atcphy_test_t8103_usb3_machine_scope(struct kunit *test) -{ - static const struct { - const char *compatible; - bool enabled; - } cases[] = { - { "apple,t8103", true }, - { "apple,t6000", false }, - { "apple,t6001", false }, - { "apple,t6002", false }, - { "apple,t8112", false }, - { "apple,t6020", false }, - { "apple,t6021", false }, - { "apple,t6022", false }, - { "apple,t8122", false }, - { "apple,t6030", false }, - { "apple,t6031", false }, - { "apple,t6034", false }, - { "apple,t8140", false }, - { "apple,t8142", false }, - }; - struct property compatible = { .name = "compatible" }; - struct device_node root = { .properties = &compatible }; - - for (size_t i = 0; i < ARRAY_SIZE(cases); i++) { - compatible.value = (void *)cases[i].compatible; - compatible.length = strlen(cases[i].compatible) + 1; - /* M2 and Pro/Max PHYs select this same fallback hardware row. */ - KUNIT_EXPECT_EQ(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8103, &root), - cases[i].enabled); - KUNIT_EXPECT_FALSE(test, - atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8122, &root)); - } +/* The handoff follows the PIPE handler generation, whatever the machine. */ +static void atcphy_test_t8103_usb3_generation_scope(struct kunit *test) +{ + KUNIT_EXPECT_TRUE(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8103)); + KUNIT_EXPECT_FALSE(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8122)); + KUNIT_EXPECT_FALSE(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8132)); + KUNIT_EXPECT_FALSE(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8140)); + KUNIT_EXPECT_FALSE(test, atcphy_has_t8103_usb3_workaround(&atcphy_hw_t8142)); } static const struct atcphy_hw *atcphy_test_match_hw(struct kunit *test, @@ -1863,7 +1838,7 @@ static void atcphy_test_idle_power_off_dt(struct kunit *test) } static struct kunit_case atcphy_mux_test_cases[] = { - KUNIT_CASE(atcphy_test_t8103_usb3_machine_scope), + KUNIT_CASE(atcphy_test_t8103_usb3_generation_scope), KUNIT_CASE(atcphy_test_idle_power_off_dt), KUNIT_CASE(atcphy_test_target_mode), KUNIT_CASE(atcphy_test_target_mode_fixed_hub), diff --git a/drivers/phy/apple/atc.c b/drivers/phy/apple/atc.c index 742ce901b1570..ce0597e632d92 100644 --- a/drivers/phy/apple/atc.c +++ b/drivers/phy/apple/atc.c @@ -588,6 +588,13 @@ enum atcphy_lane_mode { #define PIPEHANDLER_NATIVE_POWER_DOWN GENMASK(3, 0) #define PIPEHANDLER_LOCK_ACK_TIMEOUT_US 1000 +/* + * A live USB3 PIPE: the controller ACKs the lock only once it has let go of + * the PIPE, which a running link can take several ms to do. The old handoff + * asked up to ten times, 1 ms each with 5-10 ms between; this window covers + * the same span with the request held. + */ +#define PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US (100 * USEC_PER_MSEC) /* USB2 PHY regs */ #define USB2PHY_USBCTL 0x00 @@ -939,7 +946,7 @@ struct atcphy_cio_sleep { * @pipe_state: Backend the PIPE mux ("pipehandler") is routed to * @t8103_dummy_pending: A live T8103-generation handoff still needs its unlock ACK * @t8103_usb3_retry: USB3 routing owed after a deferred role or parked lane change - * @t8103_usb3_workaround: Base M1 admission for the USB3 handoff workaround + * @t8103_usb3_workaround: The T8103-generation USB3 handoff, see atcphy_has_t8103_usb3_workaround() * @pd_nb: Power domain notifier, registered with restore_after_pd_off * @pd_was_off: The power domain was switched off since the state was last * brought back; set from the notifier, cleared under @lock @@ -1626,8 +1633,10 @@ static int atcphy_pipehandler_lock_timeout(struct apple_atcphy *atcphy, u32 time set32(atcphy->regs.pipehandler + PIPEHANDLER_LOCK_REQ, PIPEHANDLER_LOCK_EN); } + /* Step coarser over a long window: the ACK is the only signal to wait for. */ ret = readl_poll_timeout(atcphy->regs.pipehandler + PIPEHANDLER_LOCK_ACK, reg, - reg & PIPEHANDLER_LOCK_EN, 10, timeout); + reg & PIPEHANDLER_LOCK_EN, + timeout > 10 * USEC_PER_MSEC ? 100 : 10, timeout); /* * A controller that still drives the PIPE can take longer than this to * let go. What that means is the caller's to decide: a best-effort lock @@ -1658,20 +1667,27 @@ static int atcphy_pipehandler_lock(struct apple_atcphy *atcphy) 6000 : PIPEHANDLER_LOCK_ACK_TIMEOUT_US); } -/* Retry only a live legacy PIPE: USB4 and stopped parking cannot clock the ACK. */ +/* + * Lock a live USB3 PIPE: the running controller clocks the ACK, and gives it + * once it has let go of the PIPE. One request, held, and the ACK polled for the + * whole live window, rather than dropping and asking again. USB4 and stopped + * parking cannot clock the ACK and do not come here. + */ static int atcphy_pipehandler_lock_live(struct apple_atcphy *atcphy) { - unsigned int attempts = atcphy->t8103_usb3_workaround ? 10 : 1; - int ret; + u32 aon; - for (unsigned int attempt = 0; attempt < attempts; attempt++) { - ret = atcphy_pipehandler_lock(atcphy); - if (!ret) - return 0; - if (attempt + 1 < attempts) - usleep_range(5000, 10000); - } - return ret; + /* The tests stand in for the controller that acknowledges the lock. */ + if (IS_ENABLED(CONFIG_PHY_APPLE_ATC_KUNIT_TEST)) + KUNIT_STATIC_STUB_REDIRECT(atcphy_pipehandler_lock_live, atcphy); + + /* A controller held in reset or clamped clocks nothing: no ACK can come. */ + aon = readl(atcphy->regs.pipehandler + PIPEHANDLER_AON_GEN); + if (!(aon & PIPEHANDLER_AON_GEN_DWC3_RESET_N) || + (aon & PIPEHANDLER_AON_GEN_DWC3_FORCE_CLAMP_EN)) + return -ETIMEDOUT; + + return atcphy_pipehandler_lock_timeout(atcphy, PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US); } static int atcphy_pipehandler_unlock(struct apple_atcphy *atcphy) @@ -9071,12 +9087,16 @@ static bool atcphy_probe_pd_notifier(struct apple_atcphy *atcphy) return !ret; } -/* The T8103 PHY compatible is also a fallback on unqualified M1/M2 variants. */ -static bool atcphy_has_t8103_usb3_workaround(const struct atcphy_hw *hw, - const struct device_node *root) +/* + * The USB3 handoff of the T8103-generation PIPE handler: a live PIPE is parked + * on the dummy backend under a held lock before a lane change, host BIST is + * skipped, and an early dwc3 role routes USB3 once Type-C asks for it. It is a + * property of that PIPE handler, so every PHY of the generation takes it: the + * apple,t8103-atcphy fallback of T8103, T600x, T8112 and T602x. + */ +static bool atcphy_has_t8103_usb3_workaround(const struct atcphy_hw *hw) { - return hw->gen == ATCPHY_GENERATION_T8103 && - of_device_is_compatible(root, "apple,t8103"); + return hw->gen == ATCPHY_GENERATION_T8103; } /* @@ -9176,7 +9196,7 @@ static int atcphy_probe(struct platform_device *pdev) atcphy->hw = of_device_get_match_data(&pdev->dev); if (!atcphy->hw) return -EINVAL; - atcphy->t8103_usb3_workaround = atcphy_has_t8103_usb3_workaround(atcphy->hw, of_root); + atcphy->t8103_usb3_workaround = atcphy_has_t8103_usb3_workaround(atcphy->hw); atcphy->dev = dev; atcphy->np = dev->of_node; diff --git a/tools/asahi/atc-usb3-tests.py b/tools/asahi/atc-usb3-tests.py index 25a0a1e21dd56..3f0d062d1bac7 100644 --- a/tools/asahi/atc-usb3-tests.py +++ b/tools/asahi/atc-usb3-tests.py @@ -5,9 +5,9 @@ Compile the actual driver functions, defines, enums and mode table. MMIO polling models a single completed timeout/success per invocation; no timing, electrical behavior, firmware, real BIST sequence or kernel mutex behavior is simulated. -The actual admission helper restricts the workaround to base M1 machines; -T600x/T8112/T602x still match the T8103 PHY fallback but keep their previous -single-poll/BIST/role behavior. OF compatible lookup is a modeled boundary. +The actual admission helper selects the handoff by PHY generation, so every +T8103-generation PHY (T8103, T600x, T8112, T602x through the T8103 fallback +compatible) takes it, whatever the machine. The DT-to-driver match contract is checked from the actual sources. CIO ownership, PIPE parking and mux disconnect are covered on every modeled generation; T8132 lane setup and electrical behavior are not modeled. Hardware qualification remains necessary. @@ -58,6 +58,7 @@ def block(source, marker): typedef uint32_t u32; #define BIT(n) (1U << (n)) #define GENMASK(h,l) ((UINT32_MAX >> (31-(h))) & (UINT32_MAX << (l))) +#define USEC_PER_MSEC 1000U /* Warnings and errors the driver reports; debug output is not counted. */ static unsigned reports; #define dev_warn(...) ((void)reports++) @@ -83,13 +84,6 @@ def block(source, marker): struct atcphy_hw { enum atcphy_generation gen; bool has_t8140_dp, dp_t8122, has_usb4, park_pipe_unlocked, park_dummy_phy, usb2_only; bool clear_boot_hold, dp_banked_tunables, pipe_lock_unacked, no_ss_device, restore_after_pd_off; }; -struct device_node { const char *const *compatible; unsigned int count; }; -static bool of_device_is_compatible(const struct device_node *root, const char *compatible) { - if (!root) return false; - for (unsigned int i = 0; i < root->count; i++) - if (!strcasecmp(root->compatible[i], compatible)) return true; - return false; -} /* ACTUAL_ADMISSION */ struct reset_controller_dev { int unused; }; struct apple_atcphy { @@ -125,6 +119,7 @@ def block(source, marker): static unsigned dummy_muxes, pending_seen_at_unlock; static unsigned usb2_power_off_calls; static unsigned ack_on; +static unsigned last_timeout; static int check_ret, bist_ret, unlock_ret, configure_ret; static bool concurrent_override_change; static bool model_t8132_off, model_t8132_usb2, model_t8132_usb3, model_t8132_pipe; @@ -151,8 +146,10 @@ def block(source, marker): return ack_on && polls >= ack_on ? PIPEHANDLER_LOCK_EN : 0; } #define readl_poll_timeout(addr,val,cond,delay,timeout) \ - ({ assert((delay) == 10 && (timeout) == (hw.gen == ATCPHY_GENERATION_T8132 ? 6000 : 1000)); \ - (val) = poll_value(addr); (cond) ? 0 : -ETIMEDOUT; }) + ({ assert((timeout) == PIPEHANDLER_LOCK_ACK_TIMEOUT_US || (timeout) == 6000 || \ + (timeout) == PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US); \ + assert((delay) == ((timeout) > 10 * USEC_PER_MSEC ? 100 : 10)); \ + last_timeout = (timeout); (val) = poll_value(addr); (cond) ? 0 : -ETIMEDOUT; }) static void usleep_range(unsigned lo, unsigned hi) { assert(lo == 5000 && hi == 10000); sleeps++; } @@ -219,19 +216,20 @@ def block(source, marker): } static void reset(enum atcphy_generation generation, bool t8140) { memset(memory, 0, sizeof(memory)); + /* A running controller: out of reset and unclamped. */ + writel(PIPEHANDLER_AON_GEN_DWC3_RESET_N, memory + PIPEHANDLER_AON_GEN); hw = (struct atcphy_hw){ .gen = generation, .has_t8140_dp = t8140 }; p = (struct apple_atcphy){ .hw = &hw, .regs = {memory, memory}, .mode = APPLE_ATCPHY_MODE_OFF, .typec_mode = APPLE_ATCPHY_MODE_USB3, .ss_tunables = true }; - const char *const compatibles[] = {generation == ATCPHY_GENERATION_T8103 ? "apple,t8103" : "apple,t8122"}; - const struct device_node root = {compatibles, 1}; - p.t8103_usb3_workaround = atcphy_has_t8103_usb3_workaround(&hw, &root); + p.t8103_usb3_workaround = atcphy_has_t8103_usb3_workaround(&hw); phy.data = &p; polls = sleeps = sets = clears = muxes = bist_old = bist_new = bist_t8132 = 0; configure_calls = restore_calls = unlocks = warnings = reports = 0; dummy_muxes = pending_seen_at_unlock = 0; usb2_power_off_calls = 0; ack_on = 1; + last_timeout = 0; check_ret = bist_ret = unlock_ret = configure_ret = 0; concurrent_override_change = false; model_t8132_off = false; @@ -239,34 +237,46 @@ def block(source, marker): model_t8132_usb3 = false; model_t8132_pipe = false; } +/* The machine no longer enters the admission; kept to name the DT row under test. */ static void reset_machine(enum atcphy_generation generation, const char *machine) { + (void)machine; reset(generation, false); - const char *const compatibles[] = {"apple,synthetic-board", machine}; - const struct device_node root = {compatibles, 2}; - p.t8103_usb3_workaround = atcphy_has_t8103_usb3_workaround(&hw, &root); } ''' TESTS = r''' static unsigned tests; #define TEST(name) do { name(); tests++; } while (0) -static void live_retry_last(void) { - reset(ATCPHY_GENERATION_T8103,false); ack_on=10; +/* A live PIPE: one request, held, and its ACK polled over the live window. */ +static void live_single_request(void) { + reset(ATCPHY_GENERATION_T8103,false); writel(BIT(7),memory+PIPEHANDLER_LOCK_REQ); assert(!atcphy_pipehandler_lock_live(&p)); - assert(polls==10 && sleeps==9 && sets==10 && clears==9); + assert(polls==1 && !sleeps && sets==1 && !clears); + assert(last_timeout==PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US); assert(readl(memory+PIPEHANDLER_LOCK_REQ)==(BIT(7)|PIPEHANDLER_LOCK_EN)); } -static void live_retry_exhausted(void) { +static void live_window_exhausted(void) { reset(ATCPHY_GENERATION_T8103,false); ack_on=0; assert(atcphy_pipehandler_lock_live(&p)==-ETIMEDOUT); - assert(polls==10 && sleeps==9 && sets==10 && clears==10); + assert(polls==1 && !sleeps && sets==1 && clears==1); + assert(last_timeout==PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US); } static void request_is_not_ack(void) { reset(ATCPHY_GENERATION_T8103,false); ack_on=2; writel(PIPEHANDLER_LOCK_EN,memory+PIPEHANDLER_LOCK_REQ); - assert(!atcphy_pipehandler_lock_live(&p)); - assert(polls==2 && sleeps==1 && sets==1 && clears==1); + assert(atcphy_pipehandler_lock_live(&p)==-ETIMEDOUT); + assert(polls==1 && !sleeps && !sets && clears==1); +} +/* A controller in reset or clamped clocks no ACK: nothing is requested. */ +static void live_held_controller_not_asked(void) { + for(unsigned clamp=0;clamp<2;clamp++) { + reset(ATCPHY_GENERATION_T8103,false); + writel(clamp?(PIPEHANDLER_AON_GEN_DWC3_RESET_N|PIPEHANDLER_AON_GEN_DWC3_FORCE_CLAMP_EN):0, + memory+PIPEHANDLER_AON_GEN); + assert(atcphy_pipehandler_lock_live(&p)==-ETIMEDOUT); + assert(!polls && !sets && !clears && !sleeps); + } } static void requested_ack_no_writes(void) { reset(ATCPHY_GENERATION_T8103,false); @@ -284,9 +294,11 @@ def block(source, marker): static void usb4_and_dead_parking_single_poll(void) { reset(ATCPHY_GENERATION_T8103,false); ack_on=0; assert(!atcphy_configure_pipehandler_usb4(&p)); assert(polls==1 && !sleeps); + assert(last_timeout==PIPEHANDLER_LOCK_ACK_TIMEOUT_US); reset(ATCPHY_GENERATION_T8103,false); ack_on=0; p.pipe_state=ATCPHY_PIPEHANDLER_STATE_USB4; assert(!atcphy_park_pipehandler(&p,true)); assert(polls==1 && !sleeps); + assert(last_timeout==PIPEHANDLER_LOCK_ACK_TIMEOUT_US); } static void early_host_and_device(void) { for(unsigned host=0;host<2;host++) { @@ -333,7 +345,7 @@ def block(source, marker): writel(BIT(7),memory+PIPEHANDLER_OVERRIDE); writel(BIT(7)|PIPEHANDLER_OVERRIDE_VAL_RXDETECT0,memory+PIPEHANDLER_OVERRIDE_VALUES); assert(atcphy_park_live_t8103_pipehandler(&p)==-ETIMEDOUT); - assert(polls==10&&sleeps==9&&!muxes&&!unlocks); + assert(polls==1&&!sleeps&&!muxes&&!unlocks); assert(readl(memory+PIPEHANDLER_OVERRIDE)==(BIT(7)|BIT(9))); assert(readl(memory+PIPEHANDLER_OVERRIDE_VALUES)==(BIT(7)|BIT(9)|PIPEHANDLER_OVERRIDE_VAL_RXDETECT0)); assert(p.pipe_state==ATCPHY_PIPEHANDLER_STATE_USB3&&!p.t8103_dummy_pending&&!p.t8103_usb3_retry&&!p.mode_dirty); @@ -351,7 +363,8 @@ def block(source, marker): } static void legacy_live_dispatch_and_generation(void) { setup_legacy_usb3();ack_on=0; - assert(atcphy_park_pipehandler(&p,false)==-ETIMEDOUT);assert(polls==10&&!muxes); + assert(atcphy_park_pipehandler(&p,false)==-ETIMEDOUT);assert(polls==1&&!muxes); + assert(last_timeout==PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US); reset(ATCPHY_GENERATION_T8122,true);p.fixed_usb2=true;p.host_active=true;p.pipe_pending=true;p.pipe_state=ATCPHY_PIPEHANDLER_STATE_USB3;ack_on=0; assert(atcphy_park_pipehandler(&p,false)==-ETIMEDOUT);assert(polls==1&&!sleeps&&!muxes&&p.mode_dirty); assert(atcphy_park_live_t8103_pipehandler(&p)==-EOPNOTSUPP); @@ -572,45 +585,31 @@ def block(source, marker): for(unsigned i=0;ihw->no_ss_device) {', 'if (false) {'), - 'no-live-retry': ('atcphy_pipehandler_lock_live', '? 10 : 1;', '? 1 : 1;'), - 'retry-later-generations': ('atcphy_pipehandler_lock_live', '? 10 : 1;', '? 10 : 10;'), - 'sleep-after-last': ('atcphy_pipehandler_lock_live', 'if (attempt + 1 < attempts)', 'if (true)'), + 'live-short-window': ('atcphy_pipehandler_lock_live', + 'PIPEHANDLER_LOCK_LIVE_ACK_TIMEOUT_US);', + 'PIPEHANDLER_LOCK_ACK_TIMEOUT_US);'), + 'live-ignores-reset': ('atcphy_pipehandler_lock_live', + '!(aon & PIPEHANDLER_AON_GEN_DWC3_RESET_N) ||', 'false ||'), + 'live-ignores-clamp': ('atcphy_pipehandler_lock_live', + '(aon & PIPEHANDLER_AON_GEN_DWC3_FORCE_CLAMP_EN))', 'false)'), 'missing-ack-check': ('atcphy_pipehandler_lock_timeout', 'if (requested & PIPEHANDLER_LOCK_EN) {', 'if (requested & PIPEHANDLER_LOCK_EN) return 0;\n' @@ -932,31 +935,19 @@ def harness(source): 'same-mode-nonusb3-keeps-role-obligation': ('atcphy_mux_switch', '\t\t\tatcphy->t8103_usb3_retry = false;\n\t\t}\n\t\t/* Retry a failed PIPE setup', '\t\t\t(void)0;\n\t\t}\n\t\t/* Retry a failed PIPE setup'), - 'admission-ignores-machine': ('bool atcphy_has_t8103_usb3_workaround', - 'of_device_is_compatible(root, "apple,t8103")', - 'true'), 'admission-ignores-generation': ('bool atcphy_has_t8103_usb3_workaround', - 'hw->gen == ATCPHY_GENERATION_T8103 &&', - 'true &&'), + 'hw->gen == ATCPHY_GENERATION_T8103;', + 'true;'), 'bist-restored-t8103': ('atcphy_configure_pipehandler', 'host && !atcphy->t8103_usb3_workaround', 'host'), 'bist-skipped-later': ('atcphy_configure_pipehandler', 'host && !atcphy->t8103_usb3_workaround', 'false'), - 'bist-skipped-fallback-machines': ('atcphy_configure_pipehandler', - 'host && !atcphy->t8103_usb3_workaround', - 'host && atcphy->hw->gen != ATCPHY_GENERATION_T8103'), 'failed-state-published': ('atcphy_configure_pipehandler', 'if (!ret) {', 'if (true) {'), 'live-generation-gate-removed': ('atcphy_park_live_t8103_pipehandler', 'if (!atcphy->t8103_usb3_workaround)', 'if (false)'), - 'live-park-dispatch-all-fallbacks': ('atcphy_park_pipehandler', - '!stopped && atcphy->t8103_usb3_workaround &&', - '!stopped && atcphy->hw->gen == ATCPHY_GENERATION_T8103 &&'), - 'mux-live-park-all-fallbacks': ('atcphy_mux_switch', - 'if (atcphy->t8103_usb3_workaround)', - 'if (atcphy->hw->gen == ATCPHY_GENERATION_T8103)'), 'no-values-restore': ('atcphy_park_live_t8103_pipehandler', 'mask32(pipe + PIPEHANDLER_OVERRIDE_VALUES, value_mask,\n' '\t\t\t values & value_mask);', diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/prefix.c b/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/prefix.c index d3b53b188e7a0..33379a765c8ac 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/prefix.c +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/dwc3/prefix.c @@ -19,6 +19,7 @@ typedef uint8_t u8; #define __iomem #define udelay(n) ((void)(n)) #define usleep_range(a, b) ((void)(a), (void)(b)) +#define USEC_PER_MSEC 1000L #define fallthrough __attribute__((fallthrough)) static unsigned int warnings, generic_warnings; static void warning(const char *message) diff --git a/tools/testing/selftests/drivers/gpu/apple-dcp/phy.py b/tools/testing/selftests/drivers/gpu/apple-dcp/phy.py index d63333af4cc33..766306d0949f9 100644 --- a/tools/testing/selftests/drivers/gpu/apple-dcp/phy.py +++ b/tools/testing/selftests/drivers/gpu/apple-dcp/phy.py @@ -255,6 +255,7 @@ def function(source, name): #define ndelay(n) ((void)(n)) #define udelay(n) ((void)(n)) #define usleep_range(a, b) ((void)(a), (void)(b)) +#define USEC_PER_MSEC 1000L enum { TYPEC_STATE_SAFE, TYPEC_STATE_USB, TYPEC_MODE_USB4, TYPEC_DP_STATE_C, TYPEC_DP_STATE_D, TYPEC_DP_STATE_E }; enum { USB_TYPEC_TBT_SID = 0x8087, USB_TYPEC_DP_SID = 0xff01 }; @@ -2095,6 +2096,7 @@ def function(name): #define guard(kind) (void) #define fallthrough __attribute__((fallthrough)) #define usleep_range(...) ((void)0) +#define USEC_PER_MSEC 1000L #define udelay(n) ((void)(n)) #define __iomem enum { TYPEC_STATE_SAFE, TYPEC_STATE_USB, TYPEC_MODE_USB4, @@ -2534,6 +2536,7 @@ def function(source, name): #define ndelay(n) ((void)(n)) #define udelay(n) ((void)(n)) #define usleep_range(a, b) ((void)(a), (void)(b)) +#define USEC_PER_MSEC 1000L enum { TYPEC_STATE_SAFE, TYPEC_STATE_USB, TYPEC_MODE_USB4, TYPEC_DP_STATE_C, TYPEC_DP_STATE_D, TYPEC_DP_STATE_E }; enum { USB_TYPEC_TBT_SID = 0x8087, USB_TYPEC_DP_SID = 0xff01 };