Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 22b3215f authored by iuchi's avatar iuchi Committed by Chun Zhang
Browse files

input: touchscreen: bu21150-driver



This driver is for Rohm's touch Analog Front End (AFE) bu21150. It
receives raw frame from touch AFE via SPI so that host processor
can process raw frame to generate touch coordinates.

Change-Id: I6548dbd064e90653c0642e1a40a8834182997c71
Signed-off-by: default avatariuchi <shinya.iuchi.jg@j-display.com>
Git-commit: 7f0911a70b204a2ba90f66b1792b5229b23342eb
Git-repo: https://github.com/JapanDisplayInc/bu21150-driver


[jinglin@codeaurora.org: fix compilation errors on 3.10 kernel, fix bug
in array definition, add commit text]
Signed-off-by: default avatarJing Lin <jinglin@codeaurora.org>
parent 3511ae2a
Loading
Loading
Loading
Loading
+30 −0
Original line number Diff line number Diff line
JDI bu21150 touch AFE controller

Required properties:

 - compatible			: should be "jdi,bu21150"
 - reg					: SPI address of the device
 - interrupt-parent		: parent of interrupt
 - interrupts			: interrupt of touch AFE
 - spi-max-frequency	: communication speed of the SPI
 - irq-gpio 			: irq gpio
 - rst-gpio				: reset gpio
 - power-supply			: type of power sequence
							Please use when adjusting the power sequence


Example:

	spi@f9966000 {
		jdi-bu21150@0 {
			compatible = "jdi,bu21150";
			reg = <0>;
			interrupt-parent = <&msmgpio>;
			interrupts = <61 0>;
			spi-max-frequency = <9600000>;
			irq-gpio = <&msmgpio 61 0>;
			rst-gpio = <&msmgpio 60 0>;
			power-supply = "apq8074-dragonboard";
		};
	};
+794 −0

File added.

Preview size limit exceeded, changes collapsed.

+187 −0

File added.

Preview size limit exceeded, changes collapsed.

+60 −0
Original line number Diff line number Diff line
/*
 * Japan Display Inc. BU21150 touch screen driver.
 *
 * Copyright (C) 2013-2014 Japan Display Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2, and only version 2, as published by the
 * Free Software Foundation.
 *
 * 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.
 *
 */
#ifndef _BU21150_H_
#define _BU21150_H_

/* return value */
#define BU21150_UNBLOCK     (5)

/* ioctl(IOCTL_CMD_RESET) */
#define BU21150_RESET_LOW   (0)
#define BU21150_RESET_HIGH  (1)

/* struct */
struct bu21150_ioctl_get_frame_data {
	char __user *buf;
	unsigned int size;
	char __user *tv; /* struct timeval* */
};

struct bu21150_ioctl_spi_data {
	unsigned long addr;
	char __user *buf;
	unsigned int count;
};

/* commands */
#define BU21150_IO_TYPE  (0xB8)
#define BU21150_IOCTL_CMD_GET_FRAME       _IOWR(BU21150_IO_TYPE, 0x01, \
		struct bu21150_ioctl_get_frame_data)
#define BU21150_IOCTL_CMD_RESET           _IO(BU21150_IO_TYPE, 0x02)
#define BU21150_IOCTL_CMD_SPI_READ        _IOW(BU21150_IO_TYPE, 0x03, \
		struct bu21150_ioctl_spi_data)
#define BU21150_IOCTL_CMD_SPI_WRITE       _IOR(BU21150_IO_TYPE, 0x04, \
		struct bu21150_ioctl_spi_data)
#define BU21150_IOCTL_CMD_UNBLOCK         _IO(BU21150_IO_TYPE, 0x05)
#define BU21150_IOCTL_CMD_SUSPEND         _IO(BU21150_IO_TYPE, 0x06)
#define BU21150_IOCTL_CMD_RESUME          _IO(BU21150_IO_TYPE, 0x07)
#define BU21150_IOCTL_CMD_UNBLOCK_RELEASE _IO(BU21150_IO_TYPE, 0x08)

#endif /* _BU21150_H_ */
+53 −0
Original line number Diff line number Diff line
/*
 * Japan Display Inc. INPUT_MT_WRAPPER Device Driver
 *
 * Copyright (C) 2013-2014 Japan Display Inc.
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * version 2, and only version 2, as published by the
 * Free Software Foundation.
 *
 * 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.
 *
 */
#ifndef _INPUT_MT_WRAPPER_H_
#define _INPUT_MT_WRAPPER_H_

#define INPUT_MT_WRAPPER_MAX_FINGERS (10)
#define INPUT_MT_WRAPPER_MIN_AREA (0)
#define INPUT_MT_WRAPPER_MAX_AREA (10)
#define INPUT_MT_WRAPPER_MIN_X (0)
#define INPUT_MT_WRAPPER_MAX_X (1080)
#define INPUT_MT_WRAPPER_MIN_Y (0)
#define INPUT_MT_WRAPPER_MAX_Y (1920)
#define INPUT_MT_WRAPPER_MIN_Z (0)
#define INPUT_MT_WRAPPER_MAX_Z (255)

struct input_mt_wrapper_touch_data {
	unsigned short x;
	unsigned short y;
	unsigned short z;
	unsigned short t;
};

struct input_mt_wrapper_ioctl_touch_data {
	struct input_mt_wrapper_touch_data touch[INPUT_MT_WRAPPER_MAX_FINGERS];
	unsigned char t_num;
};

/* commands */
#define INPUT_MT_WRAPPER_IO_TYPE  (0xB9)
#define INPUT_MT_WRAPPER_IOCTL_CMD_SET_COORDINATES \
	_IOWR(INPUT_MT_WRAPPER_IO_TYPE, 0x01, \
	struct input_mt_wrapper_ioctl_touch_data)

#endif /* _INPUT_MT_WRAPPER_H_ */