前言:下面驱动代码都可以找厂家FAE要,调试有什么问题也可以找下他们
SOC:RK3568
Linux:kernel-4.19
系统:Android12
首先stk3311分光传感器模块和距离模块两者都是使用I2c接口,可以使用轮询或者中断,本文都是轮询配置
ls_stk3x1x.c
/*
* ls_stk3x1x.c - Linux kernel modules for sensortek stk301x, stk321x and stk331x
* proximity/ambient light sensor
*
* Copyright (C) 2012~2015 Lex Hsieh / sensortek <lex_hsieh@sensortek.com.tw>
*
* 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.
*