summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-touch-raydium_spi.c
blob: 6aa2c3f1022aef02e1153620e029165e5cc613c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * arch/arm/mach-tegra/board-touch-raydium_spi.c
 *
 * Copyright (C) 2012-2014, NVIDIA Corporation.  All Rights Reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 * more details.
 *
 * You should have received a copy of the GNU General Public License along
 * with this program; if not, write to the Free Software Foundation, Inc.,
 * 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 */

#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/spi/spi.h>
#include <linux/delay.h>
#include <linux/gpio.h>
#include <linux/spi/rm31080a_ts.h>

int __init touch_init_raydium(int irq_gpio, int reset_gpio,
				struct rm_spi_ts_platform_data *rm31080ts_data,
				struct spi_board_info *rm31080a_spi_board,
				int asize)
{
	int err = RETURN_OK;
	gpio_request(irq_gpio, "raydium-irq");
	gpio_direction_input(irq_gpio);

	gpio_request(reset_gpio, "raydium-reset");
	gpio_direction_output(reset_gpio, 0);

	rm31080ts_data->gpio_reset = reset_gpio;

	rm31080a_spi_board->irq = gpio_to_irq(irq_gpio);

	spi_register_board_info(rm31080a_spi_board, asize);
	pr_info("Raydium - touch platform_id :  %d\n",
			rm31080ts_data->platform_id);

	return err;
}