2019-05-19 16:51:31 +03:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2010-03-02 14:23:42 +03:00
|
|
|
/*
|
|
|
|
* i2c-smbus.h - SMBus extensions to the I2C protocol
|
|
|
|
*
|
2020-03-16 13:22:24 +03:00
|
|
|
* Copyright (C) 2010-2019 Jean Delvare <jdelvare@suse.de>
|
2010-03-02 14:23:42 +03:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_I2C_SMBUS_H
|
|
|
|
#define _LINUX_I2C_SMBUS_H
|
|
|
|
|
|
|
|
#include <linux/i2c.h>
|
2016-06-09 17:53:48 +03:00
|
|
|
#include <linux/spinlock.h>
|
|
|
|
#include <linux/workqueue.h>
|
2010-03-02 14:23:42 +03:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* i2c_smbus_alert_setup - platform data for the smbus_alert i2c client
|
|
|
|
* @irq: IRQ number, if the smbus_alert driver should take care of interrupt
|
|
|
|
* handling
|
|
|
|
*
|
|
|
|
* If irq is not specified, the smbus_alert driver doesn't take care of
|
|
|
|
* interrupt handling. In that case it is up to the I2C bus driver to either
|
|
|
|
* handle the interrupts or to poll for alerts.
|
|
|
|
*/
|
|
|
|
struct i2c_smbus_alert_setup {
|
|
|
|
int irq;
|
|
|
|
};
|
|
|
|
|
2020-02-28 20:12:20 +03:00
|
|
|
struct i2c_client *i2c_new_smbus_alert_device(struct i2c_adapter *adapter,
|
|
|
|
struct i2c_smbus_alert_setup *setup);
|
2010-03-02 14:23:42 +03:00
|
|
|
int i2c_handle_smbus_alert(struct i2c_client *ara);
|
|
|
|
|
2017-08-24 12:31:03 +03:00
|
|
|
#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_OF)
|
|
|
|
int of_i2c_setup_smbus_alert(struct i2c_adapter *adap);
|
|
|
|
#else
|
|
|
|
static inline int of_i2c_setup_smbus_alert(struct i2c_adapter *adap)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2020-03-16 13:22:24 +03:00
|
|
|
#if IS_ENABLED(CONFIG_I2C_SMBUS) && IS_ENABLED(CONFIG_DMI)
|
|
|
|
void i2c_register_spd(struct i2c_adapter *adap);
|
|
|
|
#else
|
|
|
|
static inline void i2c_register_spd(struct i2c_adapter *adap) { }
|
|
|
|
#endif
|
|
|
|
|
2010-03-02 14:23:42 +03:00
|
|
|
#endif /* _LINUX_I2C_SMBUS_H */
|