Path: blob/master/arch/arm/mach-exynos4/setup-keypad.c
10817 views
/* linux/arch/arm/mach-exynos4/setup-keypad.c1*2* Copyright (c) 2011 Samsung Electronics Co., Ltd.3* http://www.samsung.com4*5* GPIO configuration for Exynos4 KeyPad device6*7* This program is free software; you can redistribute it and/or modify8* it under the terms of the GNU General Public License version 2 as9* published by the Free Software Foundation.10*/1112#include <linux/gpio.h>13#include <plat/gpio-cfg.h>1415void samsung_keypad_cfg_gpio(unsigned int rows, unsigned int cols)16{17/* Keypads can be of various combinations, Just making sure */1819if (rows > 8) {20/* Set all the necessary GPX2 pins: KP_ROW[0~7] */21s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), 8, S3C_GPIO_SFN(3));2223/* Set all the necessary GPX3 pins: KP_ROW[8~] */24s3c_gpio_cfgrange_nopull(EXYNOS4_GPX3(0), (rows - 8),25S3C_GPIO_SFN(3));26} else {27/* Set all the necessary GPX2 pins: KP_ROW[x] */28s3c_gpio_cfgrange_nopull(EXYNOS4_GPX2(0), rows,29S3C_GPIO_SFN(3));30}3132/* Set all the necessary GPX1 pins to special-function 3: KP_COL[x] */33s3c_gpio_cfgrange_nopull(EXYNOS4_GPX1(0), cols, S3C_GPIO_SFN(3));34}353637