Lines Matching full:arb

44 	const struct i2c_arbitrator_data *arb = i2c_mux_priv(muxc);  in i2c_arbitrator_select()  local
48 stop_time = jiffies + usecs_to_jiffies(arb->wait_free_us) + 1; in i2c_arbitrator_select()
51 gpiod_set_value(arb->our_gpio, 1); in i2c_arbitrator_select()
52 udelay(arb->slew_delay_us); in i2c_arbitrator_select()
55 stop_retry = jiffies + usecs_to_jiffies(arb->wait_retry_us) + 1; in i2c_arbitrator_select()
57 int gpio_val = gpiod_get_value(arb->their_gpio); in i2c_arbitrator_select()
68 gpiod_set_value(arb->our_gpio, 0); in i2c_arbitrator_select()
70 usleep_range(arb->wait_retry_us, arb->wait_retry_us * 2); in i2c_arbitrator_select()
74 gpiod_set_value(arb->our_gpio, 0); in i2c_arbitrator_select()
75 udelay(arb->slew_delay_us); in i2c_arbitrator_select()
87 const struct i2c_arbitrator_data *arb = i2c_mux_priv(muxc); in i2c_arbitrator_deselect() local
90 gpiod_set_value(arb->our_gpio, 0); in i2c_arbitrator_deselect()
91 udelay(arb->slew_delay_us); in i2c_arbitrator_deselect()
102 struct i2c_arbitrator_data *arb; in i2c_arbitrator_probe() local
116 muxc = i2c_mux_alloc(NULL, dev, 1, sizeof(*arb), I2C_MUX_ARBITRATOR, in i2c_arbitrator_probe()
120 arb = i2c_mux_priv(muxc); in i2c_arbitrator_probe()
125 arb->our_gpio = devm_gpiod_get(dev, "our-claim", GPIOD_OUT_LOW); in i2c_arbitrator_probe()
126 if (IS_ERR(arb->our_gpio)) { in i2c_arbitrator_probe()
128 PTR_ERR(arb->our_gpio)); in i2c_arbitrator_probe()
129 return PTR_ERR(arb->our_gpio); in i2c_arbitrator_probe()
132 arb->their_gpio = devm_gpiod_get(dev, "their-claim", GPIOD_IN); in i2c_arbitrator_probe()
133 if (IS_ERR(arb->their_gpio)) { in i2c_arbitrator_probe()
135 PTR_ERR(arb->their_gpio)); in i2c_arbitrator_probe()
136 return PTR_ERR(arb->their_gpio); in i2c_arbitrator_probe()
149 if (of_property_read_u32(np, "slew-delay-us", &arb->slew_delay_us)) in i2c_arbitrator_probe()
150 arb->slew_delay_us = 10; in i2c_arbitrator_probe()
151 if (of_property_read_u32(np, "wait-retry-us", &arb->wait_retry_us)) in i2c_arbitrator_probe()
152 arb->wait_retry_us = 3000; in i2c_arbitrator_probe()
153 if (of_property_read_u32(np, "wait-free-us", &arb->wait_free_us)) in i2c_arbitrator_probe()
154 arb->wait_free_us = 50000; in i2c_arbitrator_probe()
187 { .compatible = "i2c-arb-gpio-challenge", },
196 .name = "i2c-arb-gpio-challenge",
206 MODULE_ALIAS("platform:i2c-arb-gpio-challenge");