Lines Matching +full:rx +full:- +full:equalizer

1 // SPDX-License-Identifier: GPL-2.0-or-later
198 struct i2c_client *client = ctx->client[id]; in sii9234_writeb()
200 if (ctx->i2c_error) in sii9234_writeb()
201 return ctx->i2c_error; in sii9234_writeb()
205 dev_err(ctx->dev, "writeb: %4s[0x%02x] <- 0x%02x\n", in sii9234_writeb()
207 ctx->i2c_error = ret; in sii9234_writeb()
216 struct i2c_client *client = ctx->client[id]; in sii9234_writebm()
218 if (ctx->i2c_error) in sii9234_writebm()
219 return ctx->i2c_error; in sii9234_writebm()
223 dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n", in sii9234_writebm()
225 ctx->i2c_error = ret; in sii9234_writebm()
231 dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n", in sii9234_writebm()
233 ctx->i2c_error = ret; in sii9234_writebm()
241 dev_err(ctx->dev, "writebm: %4s[0x%02x] <- 0x%02x\n", in sii9234_writebm()
243 ctx->i2c_error = ret; in sii9234_writebm()
252 struct i2c_client *client = ctx->client[id]; in sii9234_readb()
254 if (ctx->i2c_error) in sii9234_readb()
255 return ctx->i2c_error; in sii9234_readb()
259 dev_err(ctx->dev, "readb: %4s[0x%02x]\n", in sii9234_readb()
261 ctx->i2c_error = ret; in sii9234_readb()
267 dev_err(ctx->dev, "readb: %4s[0x%02x]\n", in sii9234_readb()
269 ctx->i2c_error = ret; in sii9234_readb()
277 int ret = ctx->i2c_error; in sii9234_clear_error()
279 ctx->i2c_error = 0; in sii9234_clear_error()
415 /* Enable Tx Clock Path & Equalizer */ in sii9234_power_init()
550 dev_dbg(ctx->dev, "sii9234: detection started d3\n"); in sii9234_goto_d3()
561 ctx->state = ST_D3; in sii9234_goto_d3()
565 dev_err(ctx->dev, "%s failed\n", __func__); in sii9234_goto_d3()
566 return -1; in sii9234_goto_d3()
571 return regulator_bulk_enable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in sii9234_hw_on()
576 gpiod_set_value(ctx->gpio_reset, 1); in sii9234_hw_off()
578 regulator_bulk_disable(ARRAY_SIZE(ctx->supplies), ctx->supplies); in sii9234_hw_off()
583 gpiod_set_value(ctx->gpio_reset, 1); in sii9234_hw_reset()
585 gpiod_set_value(ctx->gpio_reset, 0); in sii9234_hw_reset()
592 mutex_lock(&ctx->lock); in sii9234_cable_in()
593 if (ctx->state != ST_OFF) in sii9234_cable_in()
602 enable_irq(to_i2c_client(ctx->dev)->irq); in sii9234_cable_in()
605 mutex_unlock(&ctx->lock); in sii9234_cable_in()
610 mutex_lock(&ctx->lock); in sii9234_cable_out()
612 if (ctx->state == ST_OFF) in sii9234_cable_out()
615 disable_irq(to_i2c_client(ctx->dev)->irq); in sii9234_cable_out()
620 ctx->state = ST_OFF; in sii9234_cable_out()
623 mutex_unlock(&ctx->lock); in sii9234_cable_out()
630 if (ctx->state == ST_D3) { in sii9234_rgnd_ready_irq()
633 dev_dbg(ctx->dev, "RGND_READY_INT\n"); in sii9234_rgnd_ready_irq()
638 dev_err(ctx->dev, "sii9234_reset() failed\n"); in sii9234_rgnd_ready_irq()
646 if (ctx->state != ST_RGND_INIT) in sii9234_rgnd_ready_irq()
654 dev_warn(ctx->dev, "RGND is not 1k\n"); in sii9234_rgnd_ready_irq()
657 dev_dbg(ctx->dev, "RGND 1K!!\n"); in sii9234_rgnd_ready_irq()
670 dev_dbg(ctx->dev, "mhl est interrupt\n"); in sii9234_mhl_established()
704 return ctx->state; in sii9234_hpd_change()
712 if (ctx->state != ST_RGND_1K) { in sii9234_rsen_change()
713 dev_err(ctx->dev, "RSEN_HIGH without RGND_1K\n"); in sii9234_rsen_change()
721 dev_dbg(ctx->dev, "MHL cable connected.. RSEN High\n"); in sii9234_rsen_change()
724 dev_dbg(ctx->dev, "RSEN lost\n"); in sii9234_rsen_change()
736 dev_dbg(ctx->dev, "sys_stat: %x\n", value); in sii9234_rsen_change()
739 dev_dbg(ctx->dev, "RSEN recovery\n"); in sii9234_rsen_change()
742 dev_dbg(ctx->dev, "RSEN Really LOW\n"); in sii9234_rsen_change()
758 dev_dbg(ctx->dev, "%s\n", __func__); in sii9234_irq_thread()
760 mutex_lock(&ctx->lock); in sii9234_irq_thread()
772 dev_dbg(ctx->dev, "irq %02x/%02x %02x/%02x %02x/%02x\n", in sii9234_irq_thread()
776 ctx->state = sii9234_rgnd_ready_irq(ctx); in sii9234_irq_thread()
778 ctx->state = sii9234_rsen_change(ctx); in sii9234_irq_thread()
780 ctx->state = sii9234_mhl_established(ctx); in sii9234_irq_thread()
782 ctx->state = sii9234_hpd_change(ctx); in sii9234_irq_thread()
784 ctx->state = ST_FAILURE; in sii9234_irq_thread()
786 ctx->state = ST_FAILURE_DISCOVERY; in sii9234_irq_thread()
799 if (ctx->state == ST_FAILURE) { in sii9234_irq_thread()
800 dev_dbg(ctx->dev, "try to reset after failure\n"); in sii9234_irq_thread()
805 if (ctx->state == ST_FAILURE_DISCOVERY) { in sii9234_irq_thread()
806 dev_err(ctx->dev, "discovery failed, no power for MHL?\n"); in sii9234_irq_thread()
808 ctx->state = ST_D3; in sii9234_irq_thread()
811 mutex_unlock(&ctx->lock); in sii9234_irq_thread()
819 struct i2c_adapter *adapter = client->adapter; in sii9234_init_resources()
822 if (!ctx->dev->of_node) { in sii9234_init_resources()
823 dev_err(ctx->dev, "not DT device\n"); in sii9234_init_resources()
824 return -ENODEV; in sii9234_init_resources()
827 ctx->gpio_reset = devm_gpiod_get(ctx->dev, "reset", GPIOD_OUT_LOW); in sii9234_init_resources()
828 if (IS_ERR(ctx->gpio_reset)) { in sii9234_init_resources()
829 dev_err(ctx->dev, "failed to get reset gpio from DT\n"); in sii9234_init_resources()
830 return PTR_ERR(ctx->gpio_reset); in sii9234_init_resources()
833 ctx->supplies[0].supply = "avcc12"; in sii9234_init_resources()
834 ctx->supplies[1].supply = "avcc33"; in sii9234_init_resources()
835 ctx->supplies[2].supply = "iovcc18"; in sii9234_init_resources()
836 ctx->supplies[3].supply = "cvcc12"; in sii9234_init_resources()
837 ret = devm_regulator_bulk_get(ctx->dev, 4, ctx->supplies); in sii9234_init_resources()
839 if (ret != -EPROBE_DEFER) in sii9234_init_resources()
840 dev_err(ctx->dev, "regulator_bulk failed\n"); in sii9234_init_resources()
844 ctx->client[I2C_MHL] = client; in sii9234_init_resources()
846 ctx->client[I2C_TPI] = devm_i2c_new_dummy_device(&client->dev, adapter, in sii9234_init_resources()
848 if (IS_ERR(ctx->client[I2C_TPI])) { in sii9234_init_resources()
849 dev_err(ctx->dev, "failed to create TPI client\n"); in sii9234_init_resources()
850 return PTR_ERR(ctx->client[I2C_TPI]); in sii9234_init_resources()
853 ctx->client[I2C_HDMI] = devm_i2c_new_dummy_device(&client->dev, adapter, in sii9234_init_resources()
855 if (IS_ERR(ctx->client[I2C_HDMI])) { in sii9234_init_resources()
856 dev_err(ctx->dev, "failed to create HDMI RX client\n"); in sii9234_init_resources()
857 return PTR_ERR(ctx->client[I2C_HDMI]); in sii9234_init_resources()
860 ctx->client[I2C_CBUS] = devm_i2c_new_dummy_device(&client->dev, adapter, in sii9234_init_resources()
862 if (IS_ERR(ctx->client[I2C_CBUS])) { in sii9234_init_resources()
863 dev_err(ctx->dev, "failed to create CBUS client\n"); in sii9234_init_resources()
864 return PTR_ERR(ctx->client[I2C_CBUS]); in sii9234_init_resources()
874 if (mode->clock > MHL1_MAX_CLK) in sii9234_mode_valid()
886 struct i2c_adapter *adapter = client->adapter; in sii9234_probe()
888 struct device *dev = &client->dev; in sii9234_probe()
893 return -ENOMEM; in sii9234_probe()
895 ctx->dev = dev; in sii9234_probe()
896 mutex_init(&ctx->lock); in sii9234_probe()
900 return -EIO; in sii9234_probe()
903 if (!client->irq) { in sii9234_probe()
905 return -EINVAL; in sii9234_probe()
908 irq_set_status_flags(client->irq, IRQ_NOAUTOEN); in sii9234_probe()
909 ret = devm_request_threaded_irq(dev, client->irq, NULL, in sii9234_probe()
924 ctx->bridge.funcs = &sii9234_bridge_funcs; in sii9234_probe()
925 ctx->bridge.of_node = dev->of_node; in sii9234_probe()
926 drm_bridge_add(&ctx->bridge); in sii9234_probe()
938 drm_bridge_remove(&ctx->bridge); in sii9234_remove()