android_kernel_xiaomi_sm8350/include/linux/of_i2c.h
Jon Smirl 2526c151c3 drivers/of: Add the of_find_i2c_device_by_node function.
The of_find_i2c_device_by_node function allows you to follow a
reference in the device tree to an i2c device node and then locate
the linux device instantiated by the device tree. Example use: an I2S
bus driver finding the i2c_device instance for a codec described by
a device tree node.

This was waiting for Anton's i2c patches that were just added.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
2009-01-09 15:49:06 -07:00

24 lines
716 B
C

/*
* Generic I2C API implementation for PowerPC.
*
* Copyright (c) 2008 Jochen Friedrich <jochen@scram.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*/
#ifndef __LINUX_OF_I2C_H
#define __LINUX_OF_I2C_H
#include <linux/i2c.h>
void of_register_i2c_devices(struct i2c_adapter *adap,
struct device_node *adap_node);
/* must call put_device() when done with returned i2c_client device */
struct i2c_client *of_find_i2c_device_by_node(struct device_node *node);
#endif /* __LINUX_OF_I2C_H */