Compare commits

...

10 Commits

23 changed files with 3003 additions and 2969 deletions

View File

@ -10,4 +10,4 @@ PWR_HLD: 0,0,A,0,1
#KERNEL_IMG: 0x62008000
#FDT_NAME: rk-kernel.dtb
#RECOVER_KEY: 1,1,0,20,0
CMDLINE:console=ttyS2 androidboot.selinux=permissive androidboot.hardware=rk30board androidboot.console=ttyS2 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00008000@0x00006000(resource),0x00008000@0x0000e000(kernel),0x00010000@0x00016000(boot),0x00010000@0x00026000(recovery),0x0001a000@0x00036000(backup),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00300000@0x00092000(system),0x00008000@0x00392000(metadata),0x00002000@0x0039A000(baseparamer),-@0x003BC000(userdata)
CMDLINE:console=ttyS2 androidboot.selinux=permissive androidboot.hardware=rk30board androidboot.console=ttyS2 root=/dev/block/mtd/by-name/linuxroot rw rootfstype=ext4 init=/sbin/init initrd=0x62000000,0x00800000 mtdparts=rk29xxnand:0x00002000@0x00002000(uboot),0x00002000@0x00004000(misc),0x00008000@0x00006000(resource),0x00008000@0x0000e000(kernel),0x00010000@0x00016000(boot),0x00010000@0x00026000(recovery),0x0001a000@0x00036000(backup),0x00040000@0x00050000(cache),0x00002000@0x00090000(kpanic),0x00300000@0x00092000(system),0x00008000@0x00392000(metadata),0x00002000@0x0039A000(baseparamer),-@0x0039C000(userdata)

View File

@ -9,5 +9,4 @@ PRODUCT_MANUFACTURER := rockchip
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.0.0 \
ro.product.ota.host = www.rockchip.com:2300
ro.product.version = 1.0.0

View File

@ -75,7 +75,6 @@ else
endif
PRODUCT_COPY_FILES += \
device/rockchip/rk3288/gps/gps.conf:system/etc/gps.conf \
device/rockchip/rk3288/gps/u-blox.conf:system/etc/u-blox.conf \
device/rockchip/rk3288/gps/gps.default.so:system/lib/hw/gps.default.so

View File

@ -1,83 +0,0 @@
###############################################################################
#
# Copyright (C) u-blox AG
# u-blox AG, Thalwil, Switzerland
#
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose without fee is hereby granted, provided that this entire notice
# is included in all copies of any software which is or includes a copy
# or modification of this software and in all copies of the supporting
# documentation for such software.
#
# THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR U-BLOX MAKES ANY
# REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
# OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
#
###############################################################################
#
# Project: Android GNSS Driver
#
###############################################################################
# $Id: gps.conf 82175 2014-06-18 15:18:01Z jon.bowern $
# $HeadURL: http://svn.u-blox.ch/GPS/SOFTWARE/hmw/android/release/release_v2.3/gps/gps.conf $
###############################################################################
###############################################################################
#
# Configuration file for an Android GPS Driver
#
###############################################################################
### Network Time Protocol (NTP) server
NTP_SERVER=europe.pool.ntp.org
# NTP_SERVER=uk.pool.ntp.org
# NTP_SERVER=asia.pool.ntp.org
# NTP_SERVER=oceania.pool.ntp.org
# NTP_SERVER=north-america.pool.ntp.org
# NTP_SERVER=south-america.pool.ntp.org
# NTP_SERVER=africa.pool.ntp.org
### AssistNow Offline (XTRA) Link
XTRA_SERVER_1=http://alp.u-blox.com/current_7d.bin
### AGPS SETTINGS ###
# Secure User Plane Location (AGPS-SUPL) - TLS connection
SUPL_HOST=supl.google.com
SUPL_PORT=7275
# Secure User Plane Location (AGPS-SUPL) - non-TLS connection
#SUPL_HOST=supl.google.com
#SUPL_PORT=7276
# sls1.sirf.com 7275 7276
# suplcn.sirf.com 7275 7276
# supl.nokia.com 7275
# supl.google.com 7275 7276
# supl.sonyericsson.com 7275
# lge.glpals.com
# 130.141.44.135
# uncomment and set the correct IP address for the SUPL test server
#SUPL_HOST=10.64.4.69
#SUPL_PORT=7275
#SUPL_HOST=supl.google.com
#SUPL_HOST=supl.nokia.com
#SUPL_HOST=supl.sonyericsson.com
#SUPL_HOST=sls1.sirf.com
###############################################################################

View File

@ -1,123 +1,23 @@
###############################################################################
#
# Copyright (C) u-blox AG
# u-blox AG, Thalwil, Switzerland
#
# All rights reserved.
#
# Permission to use, copy, modify, and distribute this software for any
# purpose without fee is hereby granted, provided that this entire notice
# is included in all copies of any software which is or includes a copy
# or modification of this software and in all copies of the supporting
# documentation for such software.
#
# THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED
# WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR U-BLOX MAKES ANY
# REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY
# OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE.
#
###############################################################################
#
# Project: Android GNSS Driver
#
###############################################################################
# $Id: u-blox.conf 83773 2014-08-07 12:20:13Z marcel.baracchi $
# $HeadURL: http://svn.u-blox.ch/GPS/SOFTWARE/hmw/android/release/release_v2.3/gps/u-blox.conf $
###############################################################################
###############################################################################
#
# u-blox Android GNSS Driver configuration file
#
###############################################################################
### Serial interface
# Device to be used by the driver
SERIAL_DEVICE /dev/ttyS3
#SERIAL_DEVICE /dev/s3c2410_serial2
#SERIAL_DEVICE /dev/i2c-4
#SERIAL_DEVICE /dev/ttyACM0
# The baudrate that should be used to communicate with the receiver and at
# which the receiver will output the NMEA messages.
BAUDRATE 9600
# The default baudrate the receiver is configured to after startup. The
# HAL interface will configure itself to this baudrate and send a command
# to the receiver to switch to the baudrate assigned to the BAUDRATE keyword
BAUDRATE_DEF 9600
### Assistance
# File path and name for aiding information
ALP_TEMP /data/aiding.ubx
# Timeout for stopping the receiver [in seconds]
STOP_TIMEOUT 5
# AssistNow Offline (AGPS-XTRA) Link interval [in hours]
XTRA_POLL_INTERVAL 20
# AssistNow Online (AGPS-UBX) Link
#UBX_HOST = agps.u-blox.com
#UBX_PORT = 46434
# Save aiding data to file system when engine stops
PERSISTENCE 1
### SUPL configuration
# SUPL requests configuration
SUPL_ALMANAC_REQUEST 0
SUPL_UTC_MODEL_REQUEST 0
SUPL_IONOSPHERIC_MODEL_REQUEST 1
SUPL_DGPS_CORRECTIONS_REQUEST 0
SUPL_REF_LOC_REQUEST 1
SUPL_REF_TIME_REQUEST 1
SUPL_AQUISITION_ASSIST_REQUEST 0
SUPL_TIME_INTEGRITY_REQUEST 0
SUPL_NAVIGATIONAL_MODEL_REQUEST 1
# The SUPL_CACERT keyword enables a TLS encryption to the SUPL server.
# It this keyword is missing, the communication will be unencrypted. If
# no value is assigned to this keyword every CA certificate will be
# accepted as valid. If a value is assigned to this keyword, this value
# will be interpreted as the path to a ca-certificate file. If the
# ca-certificate in this file does not match the root of the certificate
# chain the connection will be aborted.
#SUPL_CACERT /system/etc/ca-cert-google.pem
SUPL_CACERT
# uncomment the line below to use the certificate in SUPL test server
# SUPL_CACERT /system/etc/v1_slp_rs_de_cert.pem
# Number of retries for contacting the SUPL server
SUPL_CONNECT_RETRIES 0
# Maximum time to show the dialog for network initiated SUPL session [in seconds]
SUPL_NI_UI_TIMEOUT 10
# Maximum time for sending information to the SUPL server for network
# initiated SUPL session [in seconds]
SUPL_NI_RESPONSE_TIMEOUT 75
### Debugging aids
# Option to send fake mobile phone network information
# leave this as 0 unless you are testing
SUPL_FAKE_PHONE_CONNECTION 0
# Port number for the UDP debug server
UDP_SERVER_PORT 46434
# save decoded RRLP and UPL data to logcat
SUPL_LOG_MESSAGES 0
# create CMCC compatible A-GPS.LOG and GPS.LOG
SUPL_CMCC_LOGGING 0
# save decoded RRLP and UPL data to file SUPL-MESSAGE.LOG
SUPL_MSG_TO_FILE 0
###############################################################################
PROJECT TD1030
### Serial interface
# Device to be used by the driver
SERIAL_DEVICE /dev/ttyS3
#SERIAL_DEVICE /dev/s3c2410_serial2
#SERIAL_DEVICE /dev/i2c-4
#SERIAL_DEVICE /dev/ttyACM0
SERIAL_BAUD_RATE 9600
BDPRNADD 200
AGPS_SERVER supl.google.com
AGPS_PORT 7275
#AGPS_SERVER 211.151.53.216
#AGPS_PORT 7275
GNSS_MODE 3
TD_DEBUG_TOKEN 0
TD_DEBUG_GSV 0
TD_DEBUG_GSA 0
TD_DEBUG_NMEA 0
TD_DEBUG_FIX 0
TD_DEBUG_FUCTION 1
TD_DEBUG_CONFIGFILE 1

View File

@ -30,6 +30,5 @@ PRODUCT_MANUFACTURER := rockchip
PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/apns-full-conf.xml:system/etc/apns-conf.xml
PRODUCT_COPY_FILES += vendor/rockchip/common/phone/etc/spn-conf.xml:system/etc/spn-conf.xml
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.0.0 \
ro.product.ota.host = www.rockchip.com:2300
ro.product.version = 1.0.0

View File

@ -23,6 +23,5 @@ PRODUCT_MODEL := AIO-3288C
PRODUCT_MANUFACTURER := rockchip
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.0.0 \
ro.product.ota.host = www.rockchip.com:2300
ro.product.version = 1.0.0

View File

@ -23,6 +23,5 @@ PRODUCT_MODEL := AIO-3288J
PRODUCT_MANUFACTURER := rockchip
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.0.0 \
ro.product.ota.host = www.rockchip.com:2300
ro.product.version = 1.0.0

View File

@ -23,6 +23,5 @@ PRODUCT_MODEL := firefly-rk3288
PRODUCT_MANUFACTURER := rockchip
PRODUCT_PROPERTY_OVERRIDES += \
ro.product.version = 1.0.0 \
ro.product.ota.host = www.rockchip.com:2300
ro.product.version = 1.0.0

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,130 @@
#AP6256_NVRAM_V1.2_09202018.txt
# Cloned from bcm94345wlpagb_p2xx.txt
NVRAMRev=$Rev: 498373 $
sromrev=11
vendid=0x14e4
devid=0x43ab
manfid=0x2d0
prodid=0x06e4
macaddr=00:90:4c:c5:12:38
nocrc=1
boardtype=0x6e4
boardrev=0x1304
#XTAL 37.4MHz
xtalfreq=37400
btc_mode=1
#-----------------------------------------
#boardflags: 5GHz eTR switch by default
# 2.4GHz eTR switch by default
# bit1 for btcoex
boardflags=0x00480201
boardflags2=0x40800000
boardflags3=0x48200100
phycal_tempdelta=15
rxchain=1
txchain=1
aa2g=1
aa5g=1
tssipos5g=1
tssipos2g=1
femctrl=0
AvVmid_c0=1,165,2,100,2,100,2,100,2,100
pa2ga0=-154,5722,-656
#1pa2ga0=-195,5558,-672
pa2ga1=-118,4850,-635
pa5ga0=-193,6098,-740,-192,6095,-738,-199,5996,-730,-182,6148,-741
#3pa5ga0=-214,6002,-737,-209,6102,-746,-209,6024,-738,-200,6149,-747
#2pa5ga0=-203,5495,-683,-205,5489,-682,-207,5494,-678,-208,5549,-683
#1pa5ga0=-203,5495,-683,-205,5489,-682,-207,5494,-678,-185,6130,-740
pa5ga1=-142,4930,-655,-150,4859,-646,-156,4887,-644,-158,4864,-641
itrsw=1
pdoffset2g40ma0=10
pdoffset40ma0=0xaaaa
pdoffset80ma0=0xaaaa
extpagain5g=2
extpagain2g=2
tworangetssi2g=0
tworangetssi5g=0
# LTECX flags
# WCI2
ltecxmux=0
ltecxpadnum=0x0504
ltecxfnsel=0x22
ltecxgcigpio=0x32
maxp2ga0=78
cckbw202gpo=0x5555
cckbw20ul2gpo=0x5555
ofdmlrbw202gpo=0x2244
dot11agofdmhrbw202gpo=0x7744
ccode=DE
regrev=0
mcsbw202gpo=0x98886422
mcsbw402gpo=0x98777755
maxp5ga0=75,75,75,76
#5GHz_20MHz Offset
mcsbw205glpo=0xba753311
mcsbw205gmpo=0xba753311
mcsbw205ghpo=0xba753311
#5GHz_40MHz Offset
mcsbw405glpo=0xe8753311
mcsbw405gmpo=0xe8753311
mcsbw405ghpo=0xd9753311
#5GHz_80MHz Offset
mcsbw805glpo=0xea633311
mcsbw805gmpo=0xe7422211
mcsbw805ghpo=0xda632211
swctrlmap_2g=0x00000000,0x00000000,0x00000000,0x010000,0x3ff
swctrlmap_5g=0x00100010,0x00200020,0x00200020,0x010000,0x3fe
swctrlmapext_5g=0x00000000,0x00000000,0x00000000,0x000000,0x3
swctrlmapext_2g=0x00000000,0x00000000,0x00000000,0x000000,0x3
vcodivmode=1
deadman_to=481500000
ed_thresh2g=-54
ed_thresh5g=-54
eu_edthresh2g=-54
eu_edthresh5g=-54
#ed_thresh2g=-69
#ed_thresh5g=-69
#eu_edthresh2g=-69
#eu_edthresh5g=-69
ldo1=4
rawtempsense=0x1ff
cckPwrIdxCorr=3
cckTssiDelay=150
ofdmTssiDelay=150
txpwr2gAdcScale=1
txpwr5gAdcScale=1
dot11b_opts=0x3aa85
cbfilttype=0
#fdsslevel_ch1=6
#fdsslevel_ch11=4
#btc_mode=1
muxenab=0x10
cckdigfilttype=5
fdss_level_2g=6
#fdss_level_5g=6
#pacalshift5g=0,0,1

View File

@ -2613,6 +2613,11 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
*/
public static final int SYSTEM_UI_FLAG_MULTI_HALF_WINDOW = 0x00002000;
/**
* @hide
*/
public static final int SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR = 0x00004000;
/**
* @deprecated Use {@link #SYSTEM_UI_FLAG_LOW_PROFILE} instead.
*/

View File

@ -3909,6 +3909,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
// It's a system nav bar or a portrait screen; nav bar goes on bottom.
int top = displayHeight - overscanBottom
- mNavigationBarHeightForRotation[displayRotation];
if(mFocusedWindow != null){
int visible = PolicyControl.getSystemUiVisibility(mFocusedWindow, null) & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR;
if(visible != 0){
top = displayHeight - overscanBottom;
}
}
mTmpNavigationFrame.set(0, top, displayWidth, displayHeight - overscanBottom);
mStableBottom = mStableFullscreenBottom = mTmpNavigationFrame.top;
if (transientNavBarShowing) {
@ -4887,7 +4896,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
+ " lp.flags=0x" + Integer.toHexString(fl));
}
topIsFullscreen = ((lp.flags & WindowManager.LayoutParams.FLAG_FULLSCREEN) != 0
|| (mLastSystemUiFlags & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0)
|| (mLastSystemUiFlags & View.SYSTEM_UI_FLAG_FULLSCREEN) != 0) || ((mLastSystemUiFlags & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR) != 0)
//&& (lp.flags & WindowManager.LayoutParams.FLAG_HALF_SCREEN_WINDOW) == 0;
&& lp.align != WindowManagerPolicy.WINDOW_ALIGN_RIGHT;
topIsMultiWindow = mTopFullscreenOpaqueWindowState!=null?
@ -5031,6 +5040,32 @@ public class PhoneWindowManager implements WindowManagerPolicy {
@Override
public int focusChangedLw(WindowState lastFocus, WindowState newFocus) {
if(lastFocus != null && newFocus != null && mFocusedWindow != null){
int visible = PolicyControl.getSystemUiVisibility(lastFocus, null) & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR;
if(visible != 0){
if(lastFocus.getOwningPackage().equals(newFocus.getOwningPackage())){
if(DEBUG)Slog.w(TAG,"Not showing bar, lastFocus win SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR and newfocus packageName == lastFocus");
return 0;
}else if(newFocus.getOwningPackage().equals("android")){
if(DEBUG)Slog.w(TAG,"Not showing bar, lastFocus win SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR and newFocus win is android ");
return 0;
}
}else{
int visible2 = PolicyControl.getSystemUiVisibility(mFocusedWindow, null) & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR;
if(visible2 != 0){
if(mFocusedWindow.getOwningPackage().equals(newFocus.getOwningPackage())){
if(DEBUG)Slog.w(TAG,"Not showing bar, lastFocus win SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR and newfocus packageName == lastFocus");
return 0;
}else if(newFocus.getOwningPackage().equals("android")){
if(DEBUG)Slog.w(TAG,"Not showing bar, lastFocus win SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR and newFocus win is android ");
return 0;
}
}
}
}
mFocusedWindow = newFocus;
if ((updateSystemUiVisibilityLw()&SYSTEM_UI_CHANGING_LAYOUT) != 0) {
// If the navigation bar has been hidden or shown, we need to do another
@ -5864,6 +5899,16 @@ public class PhoneWindowManager implements WindowManagerPolicy {
if (DEBUG) Slog.d(TAG, "Not showing transient bar, wrong swipe target");
return;
}
if(!isNavBarEmpty(mLastSystemUiFlags)){
int visible = mLastSystemUiFlags & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR;
if(visible != 0){
if(DEBUG)Slog.w(TAG, "Not showing bar, SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR");
return;
}
}
//(mLastSystemUiFlags & View.SYSTEM_UI_FLAG_LAYOUT_ALWAYS_HIDE_SYSTEMBAR) != 0;
if (sb) mStatusBarController.showTransient();
if (nb) mNavigationBarController.showTransient();
mImmersiveModeConfirmation.confirmCurrentPrompt();
@ -7049,6 +7094,15 @@ public class PhoneWindowManager implements WindowManagerPolicy {
&& canHideNavigationBar();
}
private static boolean isNavBarEmpty(int systemUiFlags) {
final int disableNavigationBar = (View.STATUS_BAR_DISABLE_HOME
| View.STATUS_BAR_DISABLE_BACK
| View.STATUS_BAR_DISABLE_RECENT);
return (systemUiFlags & disableNavigationBar) == disableNavigationBar;
}
/**
* @return whether the navigation or status bar can be made translucent
*

View File

@ -468,7 +468,7 @@
compatible = "gs_mma8452";
reg = <0x1d>;
type = <SENSOR_TYPE_ACCEL>;
irq-gpio = <&gpio5 GPIO_C2 GPIO_ACTIVE_HIGH>;
irq-gpio = <&gpio8 GPIO_B0 GPIO_ACTIVE_HIGH>;
irq_enable = <1>;
poll_delay_ms = <30>;
layout = <2>;

View File

@ -493,9 +493,13 @@
status = "disabled";
};
&i2s {
pinctrl-0 = <&i2s_mclk &i2s_sclk &i2s_lrckrx &i2s_lrcktx &i2s_sdi &i2s_sdo0 /*&i2s_sdo1*/ &i2s_sdo2 &i2s_sdo3>;
};
&fb {
rockchip,disp-mode = <DUAL>;
rockchip,uboot-logo-on = <0>;
rockchip,uboot-logo-on = <1>;
rockchip,disp-policy = <DISPLAY_POLICY_BOX>;
};

View File

@ -495,6 +495,10 @@
status = "disabled";
};
&i2s {
pinctrl-0 = <&i2s_mclk &i2s_sclk &i2s_lrckrx &i2s_lrcktx &i2s_sdi &i2s_sdo0 /*&i2s_sdo1*/ &i2s_sdo2 &i2s_sdo3>;
};
&fb {
rockchip,disp-mode = <DUAL>;
rockchip,uboot-logo-on = <1>;

123
kernel/drivers/input/sensors/accel/mc3230.c Executable file → Normal file
View File

@ -37,7 +37,7 @@
#define MITECH_SENSOR_DBG
static int sensor_active(struct i2c_client *client, int enable, int rate);
//#define MITECH_SENSOR_DBG(x...) printk(x);
#define MC32X0_XOUT_REG 0x00
#define MC32X0_YOUT_REG 0x01
@ -151,7 +151,7 @@ s16 G_RAW_DATA[3];
static signed int gain_data[3];
static signed int enable_RBM_calibration = 0;
static unsigned char mc32x0_type;
static int g_value;
#if 0
#define mcprintkreg(x...) printk(x)
@ -794,9 +794,8 @@ static inline int mc3230_convert_to_int(s16 value)
return result;
}
static void mc3230_report_value(struct i2c_client *client, struct mc3230_axis *axis)
static void mc3230_report_value(struct i2c_client *client,
struct sensor_axis *axis)
{
struct sensor_private_data *mc3230 = i2c_get_clientdata(client);
//struct mc3230_axis *axis = (struct mc3230_axis *)rbuf;
@ -820,65 +819,79 @@ static int MC32X0_ReadData(struct i2c_client *client, s16 buffer[MC32X0_AXES_NUM
/** ? ?????? ???? g sensor ??? */
static int mc3230_get_data(struct i2c_client *client)
{
struct sensor_private_data* mc3230 = i2c_get_clientdata(client);
struct sensor_private_data *sensor =
(struct sensor_private_data *)i2c_get_clientdata(client);
struct sensor_platform_data *pdata = sensor->pdata;
s16 buffer[6];
int ret;
int x,y,z;
struct mc3230_axis axis;
struct sensor_platform_data *pdata = pdata = client->dev.platform_data;
//printk("%d\n==========",load_cali_flg);
if( load_cali_flg > 0)
{
ret =mcube_read_cali_file(client);
if(ret == 0)
int x, y, z;
int value = 0;
static int flag;
struct sensor_axis axis;
if (load_cali_flg > 0) {
ret = mcube_read_cali_file(client);
if (ret == 0)
load_cali_flg = ret;
else
load_cali_flg --;
//printk("load_cali %d %d\n",ret, load_cali_flg);
}
ret = MC32X0_ReadData(client, buffer);
if(ret)
{
GSE_ERR("%s I2C error: ret value=%d", __func__,ret);
return EIO;
else
load_cali_flg--;
}
ret = MC32X0_ReadData(client, buffer);
if (ret) {
GSE_ERR("%s I2C error: ret value=%d", __func__, ret);
return -EIO;
}
mcprintkfunc("%s %d %d %d \n",__func__,buffer[0],buffer[1],buffer[2]);
x = mc3230_convert_to_int(buffer[0]);
y = mc3230_convert_to_int(buffer[1]);
z = mc3230_convert_to_int(buffer[2])*2/5;
value = sensor_read_reg(client, 0x20);
axis.x = (pdata->orientation[0])*x + (pdata->orientation[1])*y + (pdata->orientation[2])*z;
axis.y = (pdata->orientation[3])*x + (pdata->orientation[4])*y + (pdata->orientation[5])*z;
axis.z = (pdata->orientation[6])*x + (pdata->orientation[7])*y + (pdata->orientation[8])*z;
if (value == 0x00) {
static int cnt;
if (cnt++ >= 20) {
sensor_active(client, 1, 0xff);
cnt = 0;
}
g_value = 4;
} else if (value == 0x01) {
g_value = 2;
} else
g_value = 1;
axis.x = x;
axis.y = y;
axis.z = z;
//printk( "%s: ------------------mc3230_GetData axis = %d %d %d--------------\n",
//__func__, axis.x, axis.y, axis.z);
//memcpy(sense_data, &axis, sizeof(axis));
mc3230_report_value(client, &axis);
//atomic_set(&data_ready, 0);
//wake_up(&data_ready_wq);
x = mc3230_convert_to_int(buffer[0]) * g_value;
y = mc3230_convert_to_int(buffer[1]) * g_value;
z = mc3230_convert_to_int(buffer[2]) * g_value;
/* ?????????? */
mutex_lock(&mc3230->data_mutex);
memcpy(&mc3230->axis, &axis, sizeof(mc3230->axis)); //get data from buffer
mutex_unlock(&mc3230->data_mutex);
/* ?? data_ready */
atomic_set(&(mc3230->data_ready), 1);
/* ??? data_ready ????? */
wake_up(&(mc3230->data_ready_wq) );
axis.x =
(pdata->orientation[0]) * x + (pdata->orientation[1]) * y +
(pdata->orientation[2]) * z;
axis.y =
(pdata->orientation[3]) * x + (pdata->orientation[4]) * y +
(pdata->orientation[5]) * z;
axis.z =
(pdata->orientation[6]) * x + (pdata->orientation[7]) * y +
(pdata->orientation[8]) * z;
/* input dev will ignore report data if data value is the same with last_value,
sample rate will not enough by this way, so just avoid this case */
if ((sensor->axis.x == axis.x) && (sensor->axis.y == axis.y) && (sensor->axis.z == axis.z)) {
if (flag) {
flag = 0;
axis.x += 1;
axis.y += 1;
axis.z += 1;
} else {
flag = 1;
axis.x -= 1;
axis.y -= 1;
axis.z -= 1;
}
}
mc3230_report_value(client, &axis);
mutex_lock(&sensor->data_mutex);
sensor->axis = axis;
mutex_unlock(&sensor->data_mutex);
return 0;
}

View File

@ -30,6 +30,7 @@ extern uint dhd_slpauto;
#define BCM4335A0_CHIP_REV 2
#define BCM4339A0_CHIP_REV 1
#define BCM43455C0_CHIP_REV 6
#define BCM43456C5_CHIP_REV 9
#define BCM4354A1_CHIP_REV 1
#define BCM4359B1_CHIP_REV 5
#endif

View File

@ -113,7 +113,7 @@ static int rk_bl_parse_dt(const void *blob)
return -ENODEV;
}
bl.id = data[1];
bl.id = fdtdec_get_int(blob, bl.node, "rockchip,pwm_id", 1);
bl.period = data[2];
pwm_node = fdt_node_offset_by_phandle(blob, data[0]);
#ifdef CONFIG_ROCKCHIP_ARCH64

Binary file not shown.