summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--arch/arm/boot/dts/omap3_h1.dts2
-rw-r--r--arch/arm/mach-omap2/board-omap3h1.c4
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3.h3
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c7
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c72
-rw-r--r--drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c7
-rw-r--r--drivers/iio/light/cm3391.c24
-rw-r--r--drivers/regulator/tps65910-regulator.c18
-rw-r--r--drivers/rtc/rtc-tps65910.c2
-rw-r--r--drivers/staging/triune/ts81001.c7
-rw-r--r--include/linux/mfd/tps65910.h4
-rw-r--r--kernel/power/wakelock.c23
-rw-r--r--kernel/printk.c16
13 files changed, 143 insertions, 46 deletions
diff --git a/arch/arm/boot/dts/omap3_h1.dts b/arch/arm/boot/dts/omap3_h1.dts
index 46c6e2d97b1..eb77ae21854 100644
--- a/arch/arm/boot/dts/omap3_h1.dts
+++ b/arch/arm/boot/dts/omap3_h1.dts
@@ -429,7 +429,7 @@ dev_pins: pinmux_pv_pins {
regulator-min-microvolt = <3300000>;
regulator-max-microvolt = <3300000>;
regulator-always-on;
- /* ti,regulator-ext-sleep-control = <8>; */
+ ti,regulator-ext-sleep-control = <0x10>;
};
/* This one goes to both SPI (for DSS) and touch. How can I
diff --git a/arch/arm/mach-omap2/board-omap3h1.c b/arch/arm/mach-omap2/board-omap3h1.c
index 5a9e4b7cfb5..7cfc31b9162 100644
--- a/arch/arm/mach-omap2/board-omap3h1.c
+++ b/arch/arm/mach-omap2/board-omap3h1.c
@@ -228,8 +228,8 @@ static struct lm3530_platform_data omap3h1_backlight_platform_data = {
//.pwm_pol_hi = true,
//.als_avrg_time = LM3530_ALS_AVRG_TIME_512ms,
.brt_ramp_law = 0,
- .brt_ramp_fall = LM3530_RAMP_TIME_1ms, /* LM3530_RAMP_TIME_1s, */
- .brt_ramp_rise = LM3530_RAMP_TIME_1ms, /* LM3530_RAMP_TIME_1s, */
+ .brt_ramp_fall = LM3530_RAMP_TIME_1s, /* LM3530_RAMP_TIME_1s, */
+ .brt_ramp_rise = LM3530_RAMP_TIME_260ms, /* LM3530_RAMP_TIME_1s, */
//.als1_resistor_sel = LM3530_ALS_IMPD_13_53kOhm,
//.als2_resistor_sel = LM3530_ALS_IMPD_Z,
//.als_vmin = 730, /* mV */
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3.h b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3.h
index 3ba58d87a29..718c8ea4280 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3.h
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3.h
@@ -162,6 +162,7 @@ struct lsm6ds3_data {
u16 fifo_threshold;
u32 samples_to_keep_on_wake;
+ u32 min_latency_samples;
int irq;
@@ -170,6 +171,8 @@ struct lsm6ds3_data {
int64_t accel_timestamp;
int64_t gyro_deltatime;
int64_t gyro_timestamp;
+ /* In seconds, using get_monotonic_boottime */
+ s64 irq_timestamp;
#ifdef CONFIG_ST_LSM6DS3_IIO_MASTER_SUPPORT
int64_t ext0_deltatime;
int64_t ext0_timestamp;
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
index b89141689a1..c555927769d 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_buffer.c
@@ -29,6 +29,8 @@
#define ST_LSM6DS3_FIFO_DATA_OUT_L 0x3e
#define ST_LSM6DS3_FIFO_DATA_OVR_2REGS 0x4000
+static int64_t last_timestamp = 0;
+
static void st_lsm6ds3_push_data_with_timestamp(struct lsm6ds3_data *cdata,
u8 index, u8 *data, int64_t timestamp)
{
@@ -154,7 +156,7 @@ void st_lsm6ds3_push_tap_to_fifo(struct lsm6ds3_data *cdata)
st_lsm6ds3_push_data_with_timestamp(
cdata, ST_INDIO_DEV_ACCEL,
fake_tap,
- cdata->accel_timestamp -1);
+ last_timestamp);
}
@@ -165,7 +167,7 @@ void st_lsm6ds3_push_d6d_to_fifo(struct lsm6ds3_data *cdata)
st_lsm6ds3_push_data_with_timestamp(
cdata, ST_INDIO_DEV_ACCEL,
d6d_signature,
- cdata->accel_timestamp -1);
+ last_timestamp);
}
@@ -221,6 +223,7 @@ void st_lsm6ds3_read_fifo(struct lsm6ds3_data *cdata, bool check_fifo_len, bool
}
}
+ last_timestamp = cdata->timestamp + 1;
read_len *= ST_LSM6DS3_BYTE_FOR_CHANNEL;
#ifdef CONFIG_ST_LSM6DS3_IIO_MASTER_SUPPORT
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
index 7298fdd274e..12dc8cbf1c7 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_core.c
@@ -204,6 +204,7 @@
st_lsm6ds3_sysfs_scale_avail, NULL , 0);
#define ST_LSM6DS3_SAMPLES_ON_WAKE_DEFAULT 52
+#define ST_LSM6DS3_MIN_LATENCY_SAMPLES 12
static struct st_lsm6ds3_selftest_table {
char *string_mode;
@@ -801,6 +802,11 @@ int st_lsm6ds3_set_fifo_decimators_and_threshold(struct lsm6ds3_data *cdata)
if (fifo_len > 0) {
fifo_threshold = fifo_len / 2;
+ if(fifo_threshold > cdata->min_latency_samples * ST_LSM6DS3_FIFO_ELEMENT_LEN_BYTE){
+ fifo_threshold = cdata->min_latency_samples * ST_LSM6DS3_FIFO_ELEMENT_LEN_BYTE;
+ fifo_threshold /= 2; //LSB of the register is 1 word
+ }
+
dev_info(cdata->dev,"setting FIFO length/threshold: 0x%x 0x%x ", fifo_len, fifo_threshold);
err = cdata->tf->write(cdata, ST_LSM6DS3_FIFO_THR_L_ADDR,
@@ -1984,6 +1990,33 @@ static ssize_t st_lsm6ds3_sysfs_suspend_samples_set(struct device *dev,
return size;
}
+
+ssize_t st_lsm6ds3_sysfs_min_latency_samples_get(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ struct lsm6ds3_sensor_data *sdata = iio_priv(dev_get_drvdata(dev));
+ ssize_t ret = sprintf(buf, "0x%02x\n", sdata->cdata->min_latency_samples);
+ return ret;
+}
+
+
+static ssize_t st_lsm6ds3_sysfs_min_latency_samples_set(struct device *dev,
+ struct device_attribute *attr, const char *buf, size_t size)
+{
+ int ret ;
+ struct lsm6ds3_sensor_data *sdata = iio_priv(dev_get_drvdata(dev));
+ uint32_t val;
+ ret = sscanf(buf, "%i", &val);
+ dev_info(sdata->cdata->dev, "read: 0x%x ", val);
+ if(ret != 1 || val <= 1){
+ return -EINVAL;
+ }
+
+ sdata->cdata->min_latency_samples = val;
+
+ return size;
+}
+
static ST_LSM6DS3_DEV_ATTR_SAMP_FREQ();
static ST_LSM6DS3_DEV_ATTR_SAMP_FREQ_AVAIL();
static ST_LSM6DS3_DEV_ATTR_SCALE_AVAIL(in_accel_scale_available);
@@ -2032,6 +2065,10 @@ static IIO_DEVICE_ATTR(suspend_samples, S_IRUGO | S_IWUSR,
st_lsm6ds3_sysfs_suspend_samples_get,
st_lsm6ds3_sysfs_suspend_samples_set, 0);
+static IIO_DEVICE_ATTR(min_latency_samples, S_IRUGO | S_IWUSR,
+ st_lsm6ds3_sysfs_min_latency_samples_get,
+ st_lsm6ds3_sysfs_min_latency_samples_set, 0);
+
static struct attribute *st_lsm6ds3_accel_attributes[] = {
&iio_dev_attr_sampling_frequency_available.dev_attr.attr,
&iio_dev_attr_in_accel_scale_available.dev_attr.attr,
@@ -2047,6 +2084,7 @@ static struct attribute *st_lsm6ds3_accel_attributes[] = {
&iio_dev_attr_sixd_wake_mask.dev_attr.attr,
&iio_dev_attr_suspend_samples.dev_attr.attr,
&iio_dev_attr_ack_wakeup_irq.dev_attr.attr,
+ &iio_dev_attr_min_latency_samples.dev_attr.attr,
NULL,
};
@@ -2165,8 +2203,9 @@ static int check_wai(struct lsm6ds3_data *cdata) {
}
get_monotonic_boottime(&ts);
- current_time = timespec_to_ns(&ts);
- if(current_time-cdata->timestamp > 20*60*1000*1000*1000) {
+ current_time = ts.tv_sec;
+ //dev_err(cdata->dev, "Last timestamp delta: %d \n", current_time-cdata->irq_timestamp);
+ if(current_time-cdata->irq_timestamp > 15/*minutes*/*60) {
return st_lsm6ds3_reset(cdata, true);
}
@@ -2189,15 +2228,17 @@ int st_lsm6ds3_reset(struct lsm6ds3_data *cdata, bool hard_reset) {
}
}
- // Power cycle the accelerometer
+ /* Power cycle the accelerometer
+ * We need to first call regulator_disable,
+ * because this accurately keeps track of the reference counting
+ * Otherwise the enable may fail to enable the regulator
+ * Then call force_disable to ensure the regulator turns off
+ * This may cause kernel warnings, but it's to be expected
+ */
- err = regulator_disable(cdata->reg_accel);
- if (err)
- return err;
+ regulator_disable(cdata->reg_accel);
- err = regulator_force_disable(cdata->reg_accel);
- if (err)
- return err;
+ regulator_force_disable(cdata->reg_accel);
msleep(100);
@@ -2215,11 +2256,6 @@ int st_lsm6ds3_reset(struct lsm6ds3_data *cdata, bool hard_reset) {
msleep(20);
- // err = check_wai(cdata);
- // if (err < 0) {
- // dev_err(cdata->dev, "Failed to check Who-Am-I register.\n");
- // return err;
- // }
err = st_lsm6ds3_init_sensor(cdata);
if (err < 0)
@@ -2251,6 +2287,7 @@ int st_lsm6ds3_common_probe(struct lsm6ds3_data *cdata, int irq)
cdata->reg_accel = 0;
cdata->fifo_data = 0;
cdata->samples_to_keep_on_wake = ST_LSM6DS3_SAMPLES_ON_WAKE_DEFAULT;
+ cdata->min_latency_samples = ST_LSM6DS3_MIN_LATENCY_SAMPLES;
for (i = 0; i < ST_INDIO_DEV_NUM; i++) {
cdata->indio_dev[i] = iio_device_alloc(sizeof(*sdata));
@@ -2464,6 +2501,12 @@ int st_lsm6ds3_common_suspend(struct lsm6ds3_data *cdata)
//limit wakeup fifo
sleep_fifo_size = cdata->samples_to_keep_on_wake * 3; //3 samples/chan
+ if(cdata->samples_to_keep_on_wake >= cdata->indio_dev[ST_INDIO_DEV_ACCEL]->buffer->length){
+ //Resize one or the other if you get this warning
+ dev_err(cdata->dev, "Error: Buffer length(%i) is to small to hold %i samples in sleep.",
+ cdata->indio_dev[ST_INDIO_DEV_ACCEL]->buffer->length, cdata->samples_to_keep_on_wake);
+ }
+
dev_info(cdata->dev , "Setting sleep fifo size to: %i, samples: %i", sleep_fifo_size, cdata->samples_to_keep_on_wake);
reg_value = sleep_fifo_size & 0xFF;
err = cdata->tf->write(cdata,
@@ -2476,6 +2519,7 @@ int st_lsm6ds3_common_suspend(struct lsm6ds3_data *cdata)
reg_value = ST_LSM6DS3_CTRL4_STOP_ON_FTH_MASK; //set stop on fth to limit fifo
err = cdata->tf->write(cdata,
ST_LSM6DS3_CTRL4_ADDR, 1, &reg_value, true);
+
#ifdef FIFO_SLEEP_DEBUG
err = cdata->tf->read(cdata,
ST_LSM6DS3_FIFO_THR_L_ADDR, 1, &reg_value, true);
diff --git a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c
index a818b14b275..a97a5da517c 100644
--- a/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c
+++ b/drivers/iio/imu/st_lsm6ds3/st_lsm6ds3_trigger.c
@@ -55,6 +55,7 @@ irqreturn_t st_lsm6ds3_save_timestamp(int irq, void *private)
get_monotonic_boottime(&ts);
cdata->timestamp = timespec_to_ns(&ts);
cdata->accel_timestamp = cdata->timestamp;
+ cdata->irq_timestamp = ts.tv_sec;
queue_work(st_lsm6ds3_wq, &cdata->data_work);
disable_irq_nosync(irq);
@@ -204,7 +205,7 @@ static void st_lsm6ds3_irq_management(struct work_struct *data_work)
}
if(!ignore_event && (tap_event || d6d_event) && cdata->first_irq_from_resume){
- wake_lock_timeout(&cdata->tap_wlock,msecs_to_jiffies(600));
+ wake_lock_timeout(&cdata->tap_wlock,msecs_to_jiffies(1000));
#ifdef WAKE_STATS_DEBUG_INFO
wakeup_irq_stayawake_count++;
#endif
@@ -213,7 +214,7 @@ static void st_lsm6ds3_irq_management(struct work_struct *data_work)
}
}
else if(d6d_event && !ignore_event) { //negative roll
- wake_lock_timeout(&cdata->tap_wlock,msecs_to_jiffies(200));
+ wake_lock_timeout(&cdata->tap_wlock,msecs_to_jiffies(600));
#ifdef WAKE_STATS_DEBUG_INFO
wakeup_irq_keepawake_count++;
#endif
@@ -269,6 +270,8 @@ static void st_lsm6ds3_irq_management(struct work_struct *data_work)
if(cdata->first_irq_from_resume){
cdata->first_irq_from_resume = 0;
+ //reset the fifo threshold
+ //fifo stop on threshold is cleared in common_resume
st_lsm6ds3_reconfigure_fifo(cdata, false);
#ifdef WAKE_STATS_DEBUG_INFO
print_wake_stats(cdata);
diff --git a/drivers/iio/light/cm3391.c b/drivers/iio/light/cm3391.c
index 8049446d98a..b6461852a57 100644
--- a/drivers/iio/light/cm3391.c
+++ b/drivers/iio/light/cm3391.c
@@ -828,6 +828,28 @@ static int cm3391_remove(struct i2c_client *client)
return 0;
}
+static int old_config = CM3391_CMD_DEFAULT;
+
+static int cm3391_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+ old_config = i2c_smbus_read_word_data(client,
+ CM3391_REG_ADDR_CMD);
+ /* Disable device */
+ i2c_smbus_write_word_data(client, CM3391_REG_ADDR_CMD,
+ CM3391_CMD_CS_DISABLE);
+
+ return 0;
+}
+
+static int cm3391_resume(struct i2c_client *client)
+{
+ /* enable device */
+ i2c_smbus_write_word_data(client, CM3391_REG_ADDR_CMD,
+ old_config);
+
+ return 0;
+}
+
static const struct i2c_device_id cm3391_id[] = {
{ "cm3391", 0},
{ }
@@ -861,6 +883,8 @@ static struct i2c_driver cm3391_driver = {
.id_table = cm3391_id,
.probe = cm3391_probe,
.remove = cm3391_remove,
+ .suspend = cm3391_suspend,
+ .resume = cm3391_resume,
};
module_i2c_driver(cm3391_driver);
diff --git a/drivers/regulator/tps65910-regulator.c b/drivers/regulator/tps65910-regulator.c
index 035eb750e28..46e5f663151 100644
--- a/drivers/regulator/tps65910-regulator.c
+++ b/drivers/regulator/tps65910-regulator.c
@@ -29,7 +29,8 @@
#define EXT_SLEEP_CONTROL (TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 | \
TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 | \
TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 | \
- TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP)
+ TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP | \
+ TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE)
/* supported VIO voltages in microvolts */
static const unsigned int VIO_VSEL_table[] = {
@@ -389,6 +390,7 @@ static int tps65910_set_mode(struct regulator_dev *dev, unsigned int mode)
return reg;
switch (mode) {
+ dev_info(&(dev->dev), "Setting regulator: %d to mode: %d", reg, mode);
case REGULATOR_MODE_NORMAL:
return tps65910_reg_update_bits(pmic->mfd, reg,
LDO_ST_MODE_BIT | LDO_ST_ON_BIT,
@@ -408,6 +410,7 @@ static unsigned int tps65910_get_mode(struct regulator_dev *dev)
struct tps65910_reg *pmic = rdev_get_drvdata(dev);
int ret, reg, value, id = rdev_get_id(dev);
+ dev_info(&(dev->dev), "Getting mode for regulator: %d", reg);
reg = pmic->get_ctrl_reg(id);
if (reg < 0)
return reg;
@@ -807,7 +810,9 @@ static int tps65910_set_ext_sleep_config(struct tps65910_reg *pmic,
en_count += ((ext_sleep_config &
TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3) != 0);
en_count += ((ext_sleep_config &
- TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP) != 0);
+ TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP) != 0);
+ en_count += ((ext_sleep_config &
+ TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE) != 0);
if (en_count > 1) {
dev_err(mfd->dev,
"External sleep control flag is not proper\n");
@@ -911,10 +916,15 @@ static int tps65910_set_ext_sleep_config(struct tps65910_reg *pmic,
}
}
- ret = tps65910_reg_clear_bits(mfd,
+ if (ext_sleep_config & TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE) {
+ ret = tps65910_reg_set_bits(mfd,
+ TPS65910_SLEEP_KEEP_LDO_ON + regoffs, bit_pos);
+ } else {
+ ret = tps65910_reg_clear_bits(mfd,
TPS65910_SLEEP_KEEP_LDO_ON + regoffs, bit_pos);
+ }
if (!ret) {
- if (ext_sleep_config & TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP)
+ if (ext_sleep_config & TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP)
ret = tps65910_reg_set_bits(mfd,
TPS65910_SLEEP_SET_LDO_OFF + regoffs, bit_pos);
else
diff --git a/drivers/rtc/rtc-tps65910.c b/drivers/rtc/rtc-tps65910.c
index a50dd46fd0a..2e4894b4732 100644
--- a/drivers/rtc/rtc-tps65910.c
+++ b/drivers/rtc/rtc-tps65910.c
@@ -200,7 +200,7 @@ static irqreturn_t tps65910_rtc_interrupt(int irq, void *rtc)
int ret;
u32 rtc_reg;
- wake_lock_timeout(&rtc_wake_lock, msecs_to_jiffies(500));
+ wake_lock_timeout(&rtc_wake_lock, msecs_to_jiffies(2000));
ret = regmap_read(tps->regmap, TPS65910_RTC_STATUS, &rtc_reg);
if (ret)
return IRQ_NONE;
diff --git a/drivers/staging/triune/ts81001.c b/drivers/staging/triune/ts81001.c
index ed6f8abc78f..85a56fe5b66 100644
--- a/drivers/staging/triune/ts81001.c
+++ b/drivers/staging/triune/ts81001.c
@@ -134,7 +134,10 @@ static int ts81001_write_i2c_blk(struct i2c_client * client, u8 reg_addr,
*
* This function reads the status from the device on the i2c bus. The
* ts81001 can be really slow to react, so we'll try again a few times
- * before accepting failure.
+ * before accepting failure.
+ *
+ * If we can't read a value, we return -1. This let's other parts of the
+ * system know that we failed to read status, and not change anything.
*/
static int ts81001_get_status (struct ts81001 * ts) {
@@ -153,7 +156,7 @@ static int ts81001_get_status (struct ts81001 * ts) {
if (err <= 0) {
olio_debug ("Error reading status from ts81001, err = %d\n",
err);
- state = err;
+ state = -1;
} else {
state = (ts81001_state_t) data;
break;
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 7f0ec4340a3..e4d5b2b8ce8 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -851,7 +851,9 @@
#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN1 0x1
#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN2 0x2
#define TPS65910_SLEEP_CONTROL_EXT_INPUT_EN3 0x4
-#define TPS65911_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8
+#define TPS65910_SLEEP_CONTROL_EXT_INPUT_SLEEP 0x8
+/* Keep the regulator fully active during sleep. Normally the regulator will go into an idle mode. */
+#define TPS65910_SLEEP_CONTROL_EXT_INPUT_ACTIVE 0x10
/*
* Sleep keepon data: Maintains the state in sleep mode
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c
index 8f50de394d2..4fd55503e00 100644
--- a/kernel/power/wakelock.c
+++ b/kernel/power/wakelock.c
@@ -18,8 +18,11 @@
#include <linux/rbtree.h>
#include <linux/slab.h>
+#define BAD_WAKELOCK "bluetooth_timer"
+
static DEFINE_MUTEX(wakelocks_lock);
+
struct wakelock {
char *name;
struct rb_node node;
@@ -189,21 +192,31 @@ int pm_wake_lock(const char *buf)
size_t len;
int ret = 0;
- if (!capable(CAP_BLOCK_SUSPEND))
+#if 0 /* OLIO our watch is entirely controlled by us, no need for this */
+ if (!capable(CAP_BLOCK_SUSPEND)) {
+ printk ("OLIO %s error return 1, lock %s\n", __FUNCTION__, buf);
return -EPERM;
+ }
+#elif 1 /* OLIO The bluetooth stack abuses this wake lock, so don't allow it to lock */
+ if (strncmp(buf, BAD_WAKELOCK, strlen(BAD_WAKELOCK)) == 0) {
+ printk ("OLIO %s error return 1, lock %s\n", __FUNCTION__, buf);
+ return -EPERM;
+ }
+#endif
while (*str && !isspace(*str))
str++;
len = str - buf;
- if (!len)
+ if (!len) {
return -EINVAL;
-
+ }
if (*str && *str != '\n') {
/* Find out if there's a valid timeout string appended. */
ret = kstrtou64(skip_spaces(str), 10, &timeout_ns);
- if (ret)
+ if (ret) {
return -EINVAL;
+ }
}
mutex_lock(&wakelocks_lock);
@@ -235,8 +248,10 @@ int pm_wake_unlock(const char *buf)
size_t len;
int ret = 0;
+#if 0 /* OLIO our watch is entirely controlled by us, no need for this */
if (!capable(CAP_BLOCK_SUSPEND))
return -EPERM;
+#endif
len = strlen(buf);
if (!len)
diff --git a/kernel/printk.c b/kernel/printk.c
index c247ad5df09..1b76b38986b 100644
--- a/kernel/printk.c
+++ b/kernel/printk.c
@@ -60,7 +60,7 @@ extern void printascii(char *);
/* We show everything that is MORE important than this.. */
#define MINIMUM_CONSOLE_LOGLEVEL 1 /* Minimum loglevel we let people use */
-#define DEFAULT_CONSOLE_LOGLEVEL 7 /* anything MORE serious than KERN_DEBUG */
+#define DEFAULT_CONSOLE_LOGLEVEL 1 /* anything MORE serious than KERN_DEBUG */
int console_printk[4] = {
DEFAULT_CONSOLE_LOGLEVEL, /* console_loglevel */
@@ -258,17 +258,7 @@ static u32 clear_idx;
static char __log_buf[__LOG_BUF_LEN] __aligned(LOG_ALIGN);
static char *log_buf = __log_buf;
static u32 log_buf_len = __LOG_BUF_LEN;
-static u64 print_clock(void)
-{
- struct timespec ts;
- u64 ts_nsec = local_clock();
-
- ts = ns_to_timespec(ts_nsec);
- monotonic_to_bootbased(&ts);
- ts_nsec = timespec_to_ns(&ts);
- return ts_nsec;
-}
/* cpu currently holding logbuf_lock */
static volatile unsigned int logbuf_cpu = UINT_MAX;
@@ -368,7 +358,7 @@ static void log_store(int facility, int level,
if (ts_nsec > 0)
msg->ts_nsec = ts_nsec;
else
- msg->ts_nsec = print_clock(); //local_clock();
+ msg->ts_nsec = local_clock();
memset(log_dict(msg) + dict_len, 0, pad_len);
msg->len = sizeof(struct log) + text_len + dict_len + pad_len;
@@ -1464,7 +1454,7 @@ static bool cont_add(int facility, int level, const char *text, size_t len)
cont.facility = facility;
cont.level = level;
cont.owner = current;
- cont.ts_nsec = print_clock(); //local_clock();
+ cont.ts_nsec = local_clock();
cont.flags = 0;
cont.cons = 0;
cont.flushed = false;