Lines Matching +full:ddc +full:- +full:i2c
1 // SPDX-License-Identifier: MIT
13 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
24 #include <linux/i2c-algo-bit.h>
25 #include <linux/i2c.h>
42 struct ast_ddc *ddc = data; in ast_ddc_algo_bit_data_setsda() local
43 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_setsda()
58 struct ast_ddc *ddc = data; in ast_ddc_algo_bit_data_setscl() local
59 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_setscl()
74 struct ast_ddc *ddc = i2c_get_adapdata(adapter); in ast_ddc_algo_bit_data_pre_xfer() local
75 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_pre_xfer()
79 * by acquiring the I/O-register lock. in ast_ddc_algo_bit_data_pre_xfer()
81 mutex_lock(&ast->modeset_lock); in ast_ddc_algo_bit_data_pre_xfer()
88 struct ast_ddc *ddc = i2c_get_adapdata(adapter); in ast_ddc_algo_bit_data_post_xfer() local
89 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_post_xfer()
91 mutex_unlock(&ast->modeset_lock); in ast_ddc_algo_bit_data_post_xfer()
96 struct ast_ddc *ddc = data; in ast_ddc_algo_bit_data_getsda() local
97 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_getsda()
118 struct ast_ddc *ddc = data; in ast_ddc_algo_bit_data_getscl() local
119 struct ast_device *ast = ddc->ast; in ast_ddc_algo_bit_data_getscl()
140 struct ast_ddc *ddc = res; in ast_ddc_release() local
142 i2c_del_adapter(&ddc->adapter); in ast_ddc_release()
147 struct drm_device *dev = &ast->base; in ast_ddc_create()
148 struct ast_ddc *ddc; in ast_ddc_create() local
153 ddc = drmm_kzalloc(dev, sizeof(*ddc), GFP_KERNEL); in ast_ddc_create()
154 if (!ddc) in ast_ddc_create()
155 return ERR_PTR(-ENOMEM); in ast_ddc_create()
156 ddc->ast = ast; in ast_ddc_create()
158 bit = &ddc->bit; in ast_ddc_create()
159 bit->data = ddc; in ast_ddc_create()
160 bit->setsda = ast_ddc_algo_bit_data_setsda; in ast_ddc_create()
161 bit->setscl = ast_ddc_algo_bit_data_setscl; in ast_ddc_create()
162 bit->getsda = ast_ddc_algo_bit_data_getsda; in ast_ddc_create()
163 bit->getscl = ast_ddc_algo_bit_data_getscl; in ast_ddc_create()
164 bit->pre_xfer = ast_ddc_algo_bit_data_pre_xfer; in ast_ddc_create()
165 bit->post_xfer = ast_ddc_algo_bit_data_post_xfer; in ast_ddc_create()
166 bit->udelay = 20; in ast_ddc_create()
167 bit->timeout = usecs_to_jiffies(2200); in ast_ddc_create()
169 adapter = &ddc->adapter; in ast_ddc_create()
170 adapter->owner = THIS_MODULE; in ast_ddc_create()
171 adapter->algo_data = bit; in ast_ddc_create()
172 adapter->dev.parent = dev->dev; in ast_ddc_create()
173 snprintf(adapter->name, sizeof(adapter->name), "AST DDC bus"); in ast_ddc_create()
174 i2c_set_adapdata(adapter, ddc); in ast_ddc_create()
178 drm_err(dev, "Failed to register bit i2c\n"); in ast_ddc_create()
182 ret = drmm_add_action_or_reset(dev, ast_ddc_release, ddc); in ast_ddc_create()
186 return &ddc->adapter; in ast_ddc_create()