Revert "Misc fixes as passed to us"

(Need to get back to stable where dialer working)

This reverts commit 929d1854e9.
This commit is contained in:
Daniel Moran (garwynn) 2014-06-04 11:50:42 -05:00
parent 04fb776943
commit 3de6b49843
9 changed files with 9 additions and 169 deletions

View File

@ -100,9 +100,6 @@ TARGET_PROVIDES_CAMERA_HAL :=
# Build lights
TARGET_PROVIDES_LIBLIGHT := true
# vibrator
BOARD_HAS_VIBRATOR_IMPLEMENTATION := ../../device/samsung/klte/vibrator/tspdrv.c
# Time services
BOARD_USES_QC_TIME_SERVICES := true

View File

@ -156,6 +156,8 @@
<ctl name="ES705 TX1 Enable" value="ZERO" />
<ctl name="ES705 RX1 Enable" value="ZERO" />
<ctl name="ES705 RX2 Enable" value="ZERO" />
<ctl name="ES325 RX1 Enable" value="ZERO" />
<ctl name="ES325 RX2 Enable" value="ZERO" />
<ctl name="ES705-AP Tx Channels" value="One" />
<ctl name="ES705 Voice Wakeup Enable" value="ZERO" />
<ctl name="ES705 Voice LPM Enable" value="ZERO" />
@ -710,14 +712,14 @@
<path name="rcv" />
<ctl name="EAR PA Gain" value="POS_6_DB" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="ES705 RX1 Enable" value="1" />
<ctl name="ES325 RX1 Enable" value="1" />
</path>
<path name="voice-call-handset-extra-vol">
<path name="rcv" />
<ctl name="EAR PA Gain" value="POS_6_DB" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="ES705 RX1 Enable" value="1" />
<ctl name="ES325 RX1 Enable" value="1" />
<ctl name="VEQ Enable" value="ZERO" />
</path>
@ -725,7 +727,7 @@
<path name="rcv" />
<ctl name="EAR PA Gain" value="POS_6_DB" />
<ctl name="RX1 Digital Volume" value="84" />
<ctl name="ES705 RX1 Enable" value="1" />
<ctl name="ES325 RX1 Enable" value="1" />
</path>
<path name="voice-call-speaker">
@ -750,7 +752,7 @@
</path>
<path name="voice-call-dock">
<ctl name="ES705 RX1 Enable" value="1" />
<ctl name="ES325 RX1 Enable" value="1" />
<path name="lineout" />
<ctl name="SLIM_0_RX Channels" value="Two" />
<ctl name="LINEOUT1 Volume" value="19" />
@ -758,7 +760,7 @@
</path>
<path name="voice-call-handset-emergency">
<ctl name="ES705 RX1 Enable" value="1" />
<ctl name="ES325 RX1 Enable" value="1" />
<path name="rcv" />
<ctl name="EAR PA Gain" value="POS_6_DB" />
<ctl name="RX1 Digital Volume" value="84" />

View File

@ -632,6 +632,8 @@ on boot
mkdir /data/misc/radio/hatp 0775 radio system
# Vibetonz
chmod 0660 /dev/tspdrv
chown root shell /dev/tspdrv
chown system system /sys/class/timed_output/vibrator/pwm_value
chmod 0660 /sys/class/timed_output/vibrator/pwm_value
chown system system /sys/class/timed_output/vibrator/pwm_max

View File

@ -28,9 +28,6 @@
# the DIAG device node is not world writable/readable.
/dev/diag 0660 system qcom_diag
# vibrator
/dev/tspdrv 0660 system system
/dev/genlock 0666 system system
/dev/kgsl 0666 system system
/dev/kgsl-3d0 0666 system system

View File

@ -1,2 +0,0 @@
# vibrator
type tspdrv_device, dev_type;

View File

@ -1 +0,0 @@
/dev/tspdrv u:object_r:tspdrv_device:s0

View File

@ -1,2 +0,0 @@
# vibrator access to system apps
allow system tspdrv_device:chr_file rw_file_perms;

View File

@ -1,123 +0,0 @@
/*
* Copyright (C) 2011 CyanogenMod Project
* Copyright (C) 2011 Daniel Hillenbrand
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>
#define LOG_NDEBUG 0
#define LOG_TAG "tspdrv"
#include <log/log.h>
#include "tspdrv.h"
int vibrator_exists()
{
int fd;
fd = open(THE_DEVICE, O_RDWR);
if(fd < 0) {
ALOGE("%s is not available.", THE_DEVICE);
return 0;
}
close(fd);
fd = open(TSPDRV_DEVICE, O_RDWR);
if(fd < 0) {
ALOGE("%s is not available.", TSPDRV_DEVICE);
return 0;
}
close(fd);
return 1;
}
static int write_value(const char *devname, int timeout_ms)
{
int nwr, fd, ret;
char value[20];
fd = open(devname, O_RDWR);
if(fd < 0)
return errno;
nwr = sprintf(value, "%d\n", timeout_ms);
ret = write(fd, value, nwr);
close(fd);
return (ret == nwr) ? 0 : -1;
}
static void tsp_set_timeout(int tspd, int timeout_ms, int actuators)
{
int tspret;
if(timeout_ms == 0) {
/* stop tspdrv kernel timer */
tspret = ioctl(tspd, TSPDRV_STOP_KERNEL_TIMER);
if(tspret != 0) {
ALOGE("TSPDRV_STOP_KERNEL_TIMER error: %d\n", tspret);
}
/* disable tspdrv amp */
if(actuators >= 1) {
tspret = ioctl(tspd, TSPDRV_DISABLE_AMP, actuators);
if(tspret != 0) {
ALOGE("TSPDRV_DISABLE_AMP error: %d\n", tspret);
}
}
} else {
if(timeout_ms > 0) {
/* enable tspdrv amp */
tspret = ioctl(tspd, TSPDRV_ENABLE_AMP, actuators);
if(tspret != 0) {
ALOGE("TSPDRV_ENABLE_AMP error: %d\n", tspret);
}
}
}
}
int sendit(int timeout_ms)
{
int tspd, tspret, actuators;
tspd = open(TSPDRV_DEVICE, O_RDWR);
if(tspd < 0) {
ALOGE("failed on opening /dev/tspdrv\n");
return errno;
}
/* send tspdrv magic number */
tspret = ioctl(tspd, TSPDRV_MAGIC_NUMBER);
if(tspret != 0) {
ALOGE("TSPDRV_MAGIC_NUMBER error: %d\n", tspret);
}
/* get number of actuators */
actuators = ioctl(tspd, TSPDRV_GET_NUM_ACTUATORS);
if(actuators < 1) {
ALOGE("TSPDRV_GET_NUM_ACTUATORS error, no actuators available\n");
close(tspd);
return -1;
}
tsp_set_timeout(tspd, timeout_ms, actuators);
close(tspd);
return write_value(THE_DEVICE, timeout_ms);
}

View File

@ -1,30 +0,0 @@
/*
* Copyright (C) 2011 CyanogenMod Project
* Copyright (C) 2011 Daniel Hillenbrand
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef __TSPDRV_H
#define __TSPDRV_H __FILE__
#define THE_DEVICE "/sys/class/timed_output/vibrator/enable"
#define TSPDRV_DEVICE "/dev/tspdrv"
#define TSPDRV_MAGIC_NUMBER 0x494D4D52
#define TSPDRV_STOP_KERNEL_TIMER _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 1)
#define TSPDRV_ENABLE_AMP _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 3)
#define TSPDRV_DISABLE_AMP _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 4)
#define TSPDRV_GET_NUM_ACTUATORS _IO(TSPDRV_MAGIC_NUMBER & 0xFF, 5)
#endif /* __TSPDRV_H */