From 9d0826879e13e8139a7b169c2365225e848ff57e Mon Sep 17 00:00:00 2001 From: Jelle van der Waa Date: Thu, 14 Jan 2016 14:06:26 +0100 Subject: sunxi: Add support for the I2C controller which is part of the PRCM Signed-off-by: Jelle van der Waa [hdegoede@redhat.com: Minor cleanups] Signed-off-by: Hans de Goede applied with fixing 2 checkpatch warnings: WARNING: please, no space before tabs Signed-off-by: Heiko Schocher --- arch/arm/cpu/armv7/sunxi/clock_sun6i.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'arch/arm/cpu/armv7/sunxi/clock_sun6i.c') diff --git a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c index 4501884e1c..1da5455c9a 100644 --- a/arch/arm/cpu/armv7/sunxi/clock_sun6i.c +++ b/arch/arm/cpu/armv7/sunxi/clock_sun6i.c @@ -77,6 +77,16 @@ int clock_twi_onoff(int port, int state) struct sunxi_ccm_reg *const ccm = (struct sunxi_ccm_reg *)SUNXI_CCM_BASE; + if (port == 5) { + if (state) + prcm_apb0_enable( + PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_I2C); + else + prcm_apb0_disable( + PRCM_APB0_GATE_PIO | PRCM_APB0_GATE_I2C); + return 0; + } + /* set the apb clock gate for twi */ if (state) setbits_le32(&ccm->apb2_gate, -- cgit