|
@@ -2,6 +2,9 @@
|
|
|
*
|
|
|
* Raydium TouchScreen driver.
|
|
|
*
|
|
|
+ * This file is provided under a dual BSD/GPLv2 license. When using or
|
|
|
+ * redistributing this file, you may do so under either license.
|
|
|
+ * Qualcomm Innovation Center, Inc. chooses to use it under GPLv2
|
|
|
* Copyright (c) 2021 Raydium tech Ltd.
|
|
|
*
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
@@ -14,9 +17,37 @@
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
* GNU General Public License for more details.
|
|
|
*
|
|
|
+ * BSD LICENSE
|
|
|
+ *
|
|
|
+ * Redistribution and use in source and binary forms, with or without
|
|
|
+ * modification, are permitted provided that the following conditions
|
|
|
+ * are met:
|
|
|
+ *
|
|
|
+ * * Redistributions of source code must retain the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer.
|
|
|
+ * * Redistributions in binary form must reproduce the above copyright
|
|
|
+ * notice, this list of conditions and the following disclaimer in
|
|
|
+ * the documentation and/or other materials provided with the
|
|
|
+ * distribution.
|
|
|
+ * * Neither the name of Google Inc. or Linaro Ltd. nor the names of
|
|
|
+ * its contributors may be used to endorse or promote products
|
|
|
+ * derived from this software without specific prior written
|
|
|
+ * permission.
|
|
|
+ * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
|
|
|
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
|
|
|
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
|
|
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
|
|
|
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
|
|
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
|
|
|
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
|
|
|
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
|
|
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
|
|
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
|
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
*/
|
|
|
|
|
|
#include <linux/timer.h>
|
|
|
+#include <linux/ktime.h>
|
|
|
#include <linux/delay.h>
|
|
|
#include <linux/unistd.h>
|
|
|
#include <linux/string.h>
|
|
@@ -29,7 +60,6 @@
|
|
|
#include "raydium_driver.h"
|
|
|
#include "chip_raydium/f303_ic_control.h"
|
|
|
|
|
|
-struct timeval timer;
|
|
|
unsigned char g_u8_m_buf[2][128];
|
|
|
unsigned char g_u8_ini_flash[0x400];
|
|
|
struct raydium_ts_data *ts;
|
|
@@ -127,14 +157,15 @@ unsigned char read_flash_data(unsigned int u32_addr, unsigned short u16_lenth)
|
|
|
unsigned int get_system_time(void)
|
|
|
{
|
|
|
/* unsigned int u32_timer;
|
|
|
+ * struct timeval timer;
|
|
|
* do_gettimeofday(&timer);
|
|
|
* u32_timer = (timer.tv_sec % 1000) * 1000 + (timer.tv_usec / 1000);
|
|
|
* return u32_timer;
|
|
|
*/
|
|
|
#if (KERNEL_VERSION(5, 0, 0) <= LINUX_VERSION_CODE)
|
|
|
- struct timespec ts;
|
|
|
+ struct timespec64 ts;
|
|
|
|
|
|
- getnstimeofday(&ts);
|
|
|
+ ktime_get_ts64(&ts);
|
|
|
return (ts.tv_sec*1000 + ts.tv_nsec/1000000);
|
|
|
#else
|
|
|
struct timeval tv;
|