mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-18 00:24:58 +08:00
e826192cc2
This patch adds IRQ support to the PASemi I2C controller driver to increase the performace of I2C transactions on platforms with PASemi I2C controllers. While primarily intended for Apple silicon platforms, this patch should also help in enabling IRQ support for older PASemi hardware as well should the need arise. This version of the patch has been tested on an M1 Ultra Mac Studio, as well as an M1 MacBook Pro, and userspace launches successfully while using the IRQ path for I2C transactions. Signed-off-by: Arminder Singh <arminders208@outlook.com> Reviewed-by: Sven Peter <sven@svenpeter.dev> Reviewed-by: Hector Martin <marcan@marcan.st> Signed-off-by: Wolfram Sang <wsa@kernel.org>
27 lines
609 B
C
27 lines
609 B
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
#include <linux/atomic.h>
|
|
#include <linux/clk.h>
|
|
#include <linux/delay.h>
|
|
#include <linux/device.h>
|
|
#include <linux/i2c.h>
|
|
#include <linux/i2c-smbus.h>
|
|
#include <linux/io.h>
|
|
#include <linux/kernel.h>
|
|
#include <linux/completion.h>
|
|
|
|
#define PASEMI_HW_REV_PCI -1
|
|
|
|
struct pasemi_smbus {
|
|
struct device *dev;
|
|
struct i2c_adapter adapter;
|
|
void __iomem *ioaddr;
|
|
unsigned int clk_div;
|
|
int hw_rev;
|
|
int use_irq;
|
|
struct completion irq_completion;
|
|
};
|
|
|
|
int pasemi_i2c_common_probe(struct pasemi_smbus *smbus);
|
|
|
|
irqreturn_t pasemi_irq_handler(int irq, void *dev_id);
|