Unverified Commit 9c9924e4 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!2564 [openEuler-1.0-LTS] Add Phytium i2c driver support

Merge Pull Request from: @shuaijiakun 
 
Add Phytium i2c driver for Phytium desktop and embedded platforms.
    
By the way, the ACPI support of this driver is also added in this commit. 
 
Link:https://gitee.com/openeuler/kernel/pulls/2564

 

Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
Reviewed-by: default avatarMao HongBo <maohongbo@phytium.com.cn>
Reviewed-by: default avatarXiongfeng Wang <wangxiongfeng2@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents ffc79dd7 777b12af
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
* Phytium I2C/SMBus controller

Required properties :

 - compatible : should be "phytium,i2c"
 - reg : Offset and length of the register set for the device
 - interrupts : <IRQ> where IRQ is the interrupt number.
 - clock-frequency : desired I2C bus clock frequency in Hz.

Optional properties:

 - interrupt-names: should be "smbus_alert" if SMBus alert
		    interrupt is supported.

Examples :

	i2c0: i2c@28011000 {
		compatible = "phytium,i2c";
		reg = <0x0 0x28011000 0x0 0x1000>;
		interrupts = <GIC_SPI 89 IRQ_TYPE_LEVEL_HIGH>;
		interrupt-names = "smbus_alert";
		clocks = <&sysclk_48mhz>;
	};
+12 −0
Original line number Diff line number Diff line
@@ -165,6 +165,16 @@ static const struct apd_device_desc hip08_i2c_desc = {
	.fixed_clk_rate = 250000000,
};

static const struct apd_device_desc phytium_i2c_desc = {
	.setup = acpi_apd_setup,
	.fixed_clk_rate = 200000000,
};

static const struct apd_device_desc phytium_pe220x_i2c_desc = {
	.setup = acpi_apd_setup,
	.fixed_clk_rate = 50000000,
};

static const struct apd_device_desc hip08_lite_i2c_desc = {
	.setup = acpi_apd_setup,
	.fixed_clk_rate = 125000000,
@@ -250,6 +260,8 @@ static const struct acpi_device_id acpi_apd_device_ids[] = {
	{ "HISI02A2", APD_ADDR(hip08_i2c_desc) },
	{ "HISI02A3", APD_ADDR(hip08_lite_i2c_desc) },
	{ "HISI0173", APD_ADDR(hip08_spi_desc) },
	{ "PHYT0003", APD_ADDR(phytium_i2c_desc) },
	{ "PHYT0038", APD_ADDR(phytium_pe220x_i2c_desc) },
#endif
	{ }
};
+28 −0
Original line number Diff line number Diff line
@@ -544,6 +544,34 @@ config I2C_DESIGNWARE_BAYTRAIL
	  the platform firmware controlling it. You should say Y if running on
	  a BayTrail system using the AXP288.

config I2C_PHYTIUM_CORE
	tristate

config I2C_PHYTIUM_PCI
	tristate "Phytium I2C PCI"
	depends on PCI && ARCH_PHYTIUM
	select I2C_PHYTIUM_CORE
	select I2C_SMBUS
	help
	  If you say yes to this option, support will be included for the
	  Phytium I2C adapter. Only master mode is supported.

	  This driver can also be built as a module.  If so, the module
	  will be called i2c-phytium-pci.

config I2C_PHYTIUM_PLATFORM
	tristate "Phytium I2C Platform"
	depends on (ACPI && COMMON_CLK) || !ACPI
	select I2C_SLAVE
	select I2C_PHYTIUM_CORE
	select I2C_SMBUS
	help
	  If you say yes to this option, support will be included for the
	  Phytium I2C adapter. Only master mode is supported.

	  This driver can also be built as a module.  If so, the module
	  will be called i2c-phytium-platform.

config I2C_DIGICOLOR
	tristate "Conexant Digicolor I2C driver"
	depends on ARCH_DIGICOLOR
+4 −0
Original line number Diff line number Diff line
@@ -54,6 +54,10 @@ i2c-designware-platform-$(CONFIG_I2C_DESIGNWARE_BAYTRAIL) += i2c-designware-bayt
obj-$(CONFIG_I2C_DESIGNWARE_PCI)	+= i2c-designware-pci.o
i2c-designware-pci-objs := i2c-designware-pcidrv.o
obj-$(CONFIG_I2C_DIGICOLOR)	+= i2c-digicolor.o
obj-$(CONFIG_I2C_PHYTIUM_CORE)	+= i2c-phytium-core.o
i2c-phytium-core-objs := i2c-phytium-common.o i2c-phytium-master.o i2c-phytium-slave.o
obj-$(CONFIG_I2C_PHYTIUM_PCI)	+= i2c-phytium-pci.o
obj-$(CONFIG_I2C_PHYTIUM_PLATFORM)	+= i2c-phytium-platform.o
obj-$(CONFIG_I2C_EFM32)		+= i2c-efm32.o
obj-$(CONFIG_I2C_EG20T)		+= i2c-eg20t.o
obj-$(CONFIG_I2C_EMEV2)		+= i2c-emev2.o
+1 −0
Original line number Diff line number Diff line
@@ -152,6 +152,7 @@ static const struct acpi_device_id dw_i2c_acpi_match[] = {
	{ "HISI02A1", 0 },
	{ "HISI02A2", 0 },
	{ "HISI02A3", 0 },
	{ "PHYT0003", 0 },
	{ "HYGO0010", ACCESS_INTR_MASK },
	{ }
};
Loading