Lines Matching defs:i2c
31 struct ast_i2c_chan *i2c = i2c_priv;
32 struct ast_device *ast = to_ast_device(i2c->dev);
47 struct ast_i2c_chan *i2c = i2c_priv;
48 struct ast_device *ast = to_ast_device(i2c->dev);
63 struct ast_i2c_chan *i2c = i2c_priv;
64 struct ast_device *ast = to_ast_device(i2c->dev);
85 struct ast_i2c_chan *i2c = i2c_priv;
86 struct ast_device *ast = to_ast_device(i2c->dev);
107 struct ast_i2c_chan *i2c = res;
109 i2c_del_adapter(&i2c->adapter);
110 kfree(i2c);
115 struct ast_i2c_chan *i2c;
118 i2c = kzalloc(sizeof(struct ast_i2c_chan), GFP_KERNEL);
119 if (!i2c)
122 i2c->adapter.owner = THIS_MODULE;
123 i2c->adapter.class = I2C_CLASS_DDC;
124 i2c->adapter.dev.parent = dev->dev;
125 i2c->dev = dev;
126 i2c_set_adapdata(&i2c->adapter, i2c);
127 snprintf(i2c->adapter.name, sizeof(i2c->adapter.name),
128 "AST i2c bit bus");
129 i2c->adapter.algo_data = &i2c->bit;
131 i2c->bit.udelay = 20;
132 i2c->bit.timeout = 2;
133 i2c->bit.data = i2c;
134 i2c->bit.setsda = ast_i2c_setsda;
135 i2c->bit.setscl = ast_i2c_setscl;
136 i2c->bit.getsda = ast_i2c_getsda;
137 i2c->bit.getscl = ast_i2c_getscl;
138 ret = i2c_bit_add_bus(&i2c->adapter);
140 drm_err(dev, "Failed to register bit i2c\n");
144 ret = drmm_add_action_or_reset(dev, ast_i2c_release, i2c);
147 return i2c;
150 kfree(i2c);