Lines Matching +full:chan +full:- +full:name
1 // SPDX-License-Identifier: GPL-2.0
11 #include <linux/i2c-algo-bit.h>
20 struct radeon_i2c_chan *chan = data; in radeon_gpio_setscl() local
21 struct radeonfb_info *rinfo = chan->rinfo; in radeon_gpio_setscl()
24 val = INREG(chan->ddc_reg) & ~(VGA_DDC_CLK_OUT_EN); in radeon_gpio_setscl()
28 OUTREG(chan->ddc_reg, val); in radeon_gpio_setscl()
29 (void)INREG(chan->ddc_reg); in radeon_gpio_setscl()
34 struct radeon_i2c_chan *chan = data; in radeon_gpio_setsda() local
35 struct radeonfb_info *rinfo = chan->rinfo; in radeon_gpio_setsda()
38 val = INREG(chan->ddc_reg) & ~(VGA_DDC_DATA_OUT_EN); in radeon_gpio_setsda()
42 OUTREG(chan->ddc_reg, val); in radeon_gpio_setsda()
43 (void)INREG(chan->ddc_reg); in radeon_gpio_setsda()
48 struct radeon_i2c_chan *chan = data; in radeon_gpio_getscl() local
49 struct radeonfb_info *rinfo = chan->rinfo; in radeon_gpio_getscl()
52 val = INREG(chan->ddc_reg); in radeon_gpio_getscl()
59 struct radeon_i2c_chan *chan = data; in radeon_gpio_getsda() local
60 struct radeonfb_info *rinfo = chan->rinfo; in radeon_gpio_getsda()
63 val = INREG(chan->ddc_reg); in radeon_gpio_getsda()
68 static int radeon_setup_i2c_bus(struct radeon_i2c_chan *chan, const char *name) in radeon_setup_i2c_bus() argument
72 snprintf(chan->adapter.name, sizeof(chan->adapter.name), in radeon_setup_i2c_bus()
73 "radeonfb %s", name); in radeon_setup_i2c_bus()
74 chan->adapter.owner = THIS_MODULE; in radeon_setup_i2c_bus()
75 chan->adapter.algo_data = &chan->algo; in radeon_setup_i2c_bus()
76 chan->adapter.dev.parent = &chan->rinfo->pdev->dev; in radeon_setup_i2c_bus()
77 chan->algo.setsda = radeon_gpio_setsda; in radeon_setup_i2c_bus()
78 chan->algo.setscl = radeon_gpio_setscl; in radeon_setup_i2c_bus()
79 chan->algo.getsda = radeon_gpio_getsda; in radeon_setup_i2c_bus()
80 chan->algo.getscl = radeon_gpio_getscl; in radeon_setup_i2c_bus()
81 chan->algo.udelay = 10; in radeon_setup_i2c_bus()
82 chan->algo.timeout = 20; in radeon_setup_i2c_bus()
83 chan->algo.data = chan; in radeon_setup_i2c_bus()
85 i2c_set_adapdata(&chan->adapter, chan); in radeon_setup_i2c_bus()
88 radeon_gpio_setsda(chan, 1); in radeon_setup_i2c_bus()
89 radeon_gpio_setscl(chan, 1); in radeon_setup_i2c_bus()
92 rc = i2c_bit_add_bus(&chan->adapter); in radeon_setup_i2c_bus()
94 dev_dbg(&chan->rinfo->pdev->dev, "I2C bus %s registered.\n", name); in radeon_setup_i2c_bus()
96 dev_warn(&chan->rinfo->pdev->dev, "Failed to register I2C bus %s.\n", name); in radeon_setup_i2c_bus()
102 rinfo->i2c[0].rinfo = rinfo; in radeon_create_i2c_busses()
103 rinfo->i2c[0].ddc_reg = GPIO_MONID; in radeon_create_i2c_busses()
105 rinfo->i2c[0].adapter.class = I2C_CLASS_HWMON; in radeon_create_i2c_busses()
107 radeon_setup_i2c_bus(&rinfo->i2c[0], "monid"); in radeon_create_i2c_busses()
109 rinfo->i2c[1].rinfo = rinfo; in radeon_create_i2c_busses()
110 rinfo->i2c[1].ddc_reg = GPIO_DVI_DDC; in radeon_create_i2c_busses()
111 radeon_setup_i2c_bus(&rinfo->i2c[1], "dvi"); in radeon_create_i2c_busses()
113 rinfo->i2c[2].rinfo = rinfo; in radeon_create_i2c_busses()
114 rinfo->i2c[2].ddc_reg = GPIO_VGA_DDC; in radeon_create_i2c_busses()
115 radeon_setup_i2c_bus(&rinfo->i2c[2], "vga"); in radeon_create_i2c_busses()
117 rinfo->i2c[3].rinfo = rinfo; in radeon_create_i2c_busses()
118 rinfo->i2c[3].ddc_reg = GPIO_CRT2_DDC; in radeon_create_i2c_busses()
119 radeon_setup_i2c_bus(&rinfo->i2c[3], "crt2"); in radeon_create_i2c_busses()
124 if (rinfo->i2c[0].rinfo) in radeon_delete_i2c_busses()
125 i2c_del_adapter(&rinfo->i2c[0].adapter); in radeon_delete_i2c_busses()
126 rinfo->i2c[0].rinfo = NULL; in radeon_delete_i2c_busses()
128 if (rinfo->i2c[1].rinfo) in radeon_delete_i2c_busses()
129 i2c_del_adapter(&rinfo->i2c[1].adapter); in radeon_delete_i2c_busses()
130 rinfo->i2c[1].rinfo = NULL; in radeon_delete_i2c_busses()
132 if (rinfo->i2c[2].rinfo) in radeon_delete_i2c_busses()
133 i2c_del_adapter(&rinfo->i2c[2].adapter); in radeon_delete_i2c_busses()
134 rinfo->i2c[2].rinfo = NULL; in radeon_delete_i2c_busses()
136 if (rinfo->i2c[3].rinfo) in radeon_delete_i2c_busses()
137 i2c_del_adapter(&rinfo->i2c[3].adapter); in radeon_delete_i2c_busses()
138 rinfo->i2c[3].rinfo = NULL; in radeon_delete_i2c_busses()
146 edid = fb_ddc_read(&rinfo->i2c[conn-1].adapter); in radeon_probe_i2c_connector()
156 if (rinfo->is_mobility /*&& conn == ddc_dvi*/ && in radeon_probe_i2c_connector()