Lines Matching refs:fn

132 	struct rmi_function *fn = to_rmi_function(dev);  in rmi_release_function()  local
134 kfree(fn); in rmi_release_function()
150 struct rmi_function *fn = to_rmi_function(dev); in rmi_function_match() local
152 return fn->fd.function_number == handler->func; in rmi_function_match()
156 static void rmi_function_of_probe(struct rmi_function *fn) in rmi_function_of_probe() argument
159 struct device_node *node = fn->rmi_dev->xport->dev->of_node; in rmi_function_of_probe()
162 fn->fd.function_number); in rmi_function_of_probe()
163 fn->dev.of_node = of_get_child_by_name(node, of_name); in rmi_function_of_probe()
166 static inline void rmi_function_of_probe(struct rmi_function *fn) in rmi_function_of_probe() argument
174 static int rmi_create_function_irq(struct rmi_function *fn, in rmi_create_function_irq() argument
177 struct rmi_driver_data *drvdata = dev_get_drvdata(&fn->rmi_dev->dev); in rmi_create_function_irq()
180 for (i = 0; i < fn->num_of_irqs; i++) { in rmi_create_function_irq()
181 set_bit(fn->irq_pos + i, fn->irq_mask); in rmi_create_function_irq()
183 fn->irq[i] = irq_create_mapping(drvdata->irqdomain, in rmi_create_function_irq()
184 fn->irq_pos + i); in rmi_create_function_irq()
186 irq_set_chip_data(fn->irq[i], fn); in rmi_create_function_irq()
187 irq_set_chip_and_handler(fn->irq[i], &rmi_irq_chip, in rmi_create_function_irq()
189 irq_set_nested_thread(fn->irq[i], 1); in rmi_create_function_irq()
191 error = devm_request_threaded_irq(&fn->dev, fn->irq[i], NULL, in rmi_create_function_irq()
193 dev_name(&fn->dev), fn); in rmi_create_function_irq()
195 dev_err(&fn->dev, "Error %d registering IRQ\n", error); in rmi_create_function_irq()
205 struct rmi_function *fn = to_rmi_function(dev); in rmi_function_probe() local
210 rmi_function_of_probe(fn); in rmi_function_probe()
213 error = handler->probe(fn); in rmi_function_probe()
218 if (fn->num_of_irqs && handler->attention) { in rmi_function_probe()
219 error = rmi_create_function_irq(fn, handler); in rmi_function_probe()
229 struct rmi_function *fn = to_rmi_function(dev); in rmi_function_remove() local
234 handler->remove(fn); in rmi_function_remove()
239 int rmi_register_function(struct rmi_function *fn) in rmi_register_function() argument
241 struct rmi_device *rmi_dev = fn->rmi_dev; in rmi_register_function()
244 device_initialize(&fn->dev); in rmi_register_function()
246 dev_set_name(&fn->dev, "%s.fn%02x", in rmi_register_function()
247 dev_name(&rmi_dev->dev), fn->fd.function_number); in rmi_register_function()
249 fn->dev.parent = &rmi_dev->dev; in rmi_register_function()
250 fn->dev.type = &rmi_function_type; in rmi_register_function()
251 fn->dev.bus = &rmi_bus_type; in rmi_register_function()
253 error = device_add(&fn->dev); in rmi_register_function()
257 dev_name(&fn->dev)); in rmi_register_function()
262 fn->fd.function_number); in rmi_register_function()
267 put_device(&fn->dev); in rmi_register_function()
271 void rmi_unregister_function(struct rmi_function *fn) in rmi_unregister_function() argument
275 rmi_dbg(RMI_DEBUG_CORE, &fn->dev, "Unregistering F%02X.\n", in rmi_unregister_function()
276 fn->fd.function_number); in rmi_unregister_function()
278 device_del(&fn->dev); in rmi_unregister_function()
279 of_node_put(fn->dev.of_node); in rmi_unregister_function()
280 put_device(&fn->dev); in rmi_unregister_function()
282 for (i = 0; i < fn->num_of_irqs; i++) in rmi_unregister_function()
283 irq_dispose_mapping(fn->irq[i]); in rmi_unregister_function()