This code hasn't been called since the calls to it randomly disappeared in 71e6be0ccbd5 "sunxi: get u-boot mmc spl work" and 4d29a5dd7414 "sunxi: further clean sunxi platform". It seems to have only ever been used as test code anyway.
Signed-off-by: Ian Campbell <[email protected]> --- arch/arm/cpu/armv7/sunxi/Makefile | 1 - arch/arm/cpu/armv7/sunxi/key.c | 54 ----------------------------------- arch/arm/include/asm/arch-sunxi/key.h | 37 ------------------------ 3 files changed, 92 deletions(-) delete mode 100644 arch/arm/cpu/armv7/sunxi/key.c delete mode 100644 arch/arm/include/asm/arch-sunxi/key.h diff --git a/arch/arm/cpu/armv7/sunxi/Makefile b/arch/arm/cpu/armv7/sunxi/Makefile index e6d8fa9..83b7c1a 100644 --- a/arch/arm/cpu/armv7/sunxi/Makefile +++ b/arch/arm/cpu/armv7/sunxi/Makefile @@ -21,7 +21,6 @@ obj-$(CONFIG_SYS_SECONDARY_ON) += secondary_init.o obj-$(CONFIG_SYS_SECONDARY_ON) += smp.o ifndef CONFIG_SPL_BUILD -obj-y += key.o obj-y += cpu_info.o ifdef CONFIG_CMD_WATCHDOG obj-$(CONFIG_CMD_WATCHDOG) += cmd_watchdog.o diff --git a/arch/arm/cpu/armv7/sunxi/key.c b/arch/arm/cpu/armv7/sunxi/key.c deleted file mode 100644 index fcdabd3..0000000 --- a/arch/arm/cpu/armv7/sunxi/key.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * (C) Copyright 2007-2011 - * Allwinner Technology Co., Ltd. <www.allwinnertech.com> - * Tom Cubie <[email protected]> - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#include <common.h> -#include <asm/io.h> -#include <asm/arch/cpu.h> -#include <asm/arch/key.h> -#include <asm/arch/sys_proto.h> - -int sunxi_key_init(void) -{ - struct sunxi_lradc *sunxi_key_base = - (struct sunxi_lradc *)SUNXI_LRADC_BASE; - - sr32(&sunxi_key_base->ctrl, 0, 1, LRADC_EN); - sr32(&sunxi_key_base->ctrl, 2, 2, LRADC_SAMPLE_RATE); - sr32(&sunxi_key_base->ctrl, 4, 2, LEVELB_VOL); - sr32(&sunxi_key_base->ctrl, 6, 1, LRADC_HOLD_EN); - sr32(&sunxi_key_base->ctrl, 12, 2, KEY_MODE_SELECT); - - /* disable all key irq */ - writel(0x0, &sunxi_key_base->intc); - /* clear all key pending */ - writel(0xffffffff, &sunxi_key_base->ints); - - return 0; -} - -u32 sunxi_read_key(void) -{ - u32 ints; - u32 key = 0; - struct sunxi_lradc *sunxi_key_base = - (struct sunxi_lradc *)SUNXI_LRADC_BASE; - - ints = readl(&sunxi_key_base->ints); - - /* if there is already data pending, - read it */ - if (ints & ADC0_DATA_PENDING) { - key = readl(&sunxi_key_base->data0); -#ifdef DEBUG - printf("key pressed, value=0x%x\n", key); -#endif - } - /* clear the pending data */ - writel(ints, &sunxi_key_base->ints); - return key; -} diff --git a/arch/arm/include/asm/arch-sunxi/key.h b/arch/arm/include/asm/arch-sunxi/key.h deleted file mode 100644 index b2e1faa..0000000 --- a/arch/arm/include/asm/arch-sunxi/key.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - * (C) Copyright 2007-2011 - * Allwinner Technology Co., Ltd. <www.allwinnertech.com> - * Tom Cubie <[email protected]> - * - * SPDX-License-Identifier: GPL-2.0+ - */ - -#ifndef _SUNXI_KEY_H -#define _SUNXI_KEY_H - -#include <linux/types.h> - -struct sunxi_lradc { - u32 ctrl; /* lradc control */ - u32 intc; /* interrupt control */ - u32 ints; /* interrupt status */ - u32 data0; /* lradc 0 data */ - u32 data1; /* lradc 1 data */ -}; - -#define LRADC_EN 0x1 /* LRADC enable */ -#define LRADC_SAMPLE_RATE 0x2 /* 32.25 Hz */ -#define LEVELB_VOL 0x2 /* 0x33(~1.6v) */ -#define LRADC_HOLD_EN 0x1 /* sample hold enable */ -#define KEY_MODE_SELECT 0x0 /* normal mode */ - -#define ADC0_DATA_PENDING (0x1 << 0) /* adc0 has data */ -#define ADC0_KEYDOWN_PENDING (0x1 << 1) /* key down */ -#define ADC0_HOLDKEY_PENDING (0x1 << 2) /* key hold */ -#define ADC0_ALRDY_HOLD_PENDING (0x1 << 3) /* key already hold */ -#define ADC0_KEYUP_PENDING (0x1 << 4) /* key up */ - -int sunxi_key_init(void); -u32 sunxi_read_key(void); - -#endif -- 1.8.5.3 -- You received this message because you are subscribed to the Google Groups "linux-sunxi" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
