Skip to content

Commit

Permalink
Merge android-msm-floral-4.14-qt-qpr1 into android-msm-floral-4.14
Browse files Browse the repository at this point in the history
Change-Id: If447f27270018c9890219507643a2896e2b793d9
Signed-off-by: Petri Gynther <[email protected]>
  • Loading branch information
Petri Gynther committed Aug 12, 2019
2 parents 6eca3b5 + 756cdfe commit d678237
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 100 deletions.
5 changes: 1 addition & 4 deletions arch/arm64/boot/dts/google/sm8150-floral-rainbow.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
reg = <0x20>;
vio-supply = <&max77826_ldo13>;
vdd-supply = <&max77826_ldo15>;
pmic_buck1-supply = <&max77826_buck1>;
pmic_buck2-supply = <&max77826_buck2>;
regulator-names = "vio", "vdd", "pmic_buck1",
"pmic_buck2";
regulator-names = "vio", "vdd";
status = "ok";
};
};
Expand Down
9 changes: 9 additions & 0 deletions drivers/input/misc/lm36011/lm36011_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,6 +1899,7 @@ static enum silego_self_test_result_type silego_self_test(
struct led_laser_ctrl_t *ctrl)
{
int rc, retry;
uint32_t data;
enum silego_self_test_result_type result = SILEGO_TEST_FAILED;

mutex_lock(&ctrl->cam_sensor_mutex);
Expand Down Expand Up @@ -1951,6 +1952,14 @@ static enum silego_self_test_result_type silego_self_test(
goto release_resource;
}

if (lm36011_read_data(ctrl, ENABLE_REG, &data) < 0)
dev_warn(ctrl->soc_info.dev, "fail to read back reg 0x%x",
ENABLE_REG);
else
dev_info(ctrl->soc_info.dev,
"laser driver mode has been set to 0x%x", data);


/* wait for torch reach to 5 ms pulse width */
usleep_range(5000, 10000);

Expand Down
91 changes: 1 addition & 90 deletions drivers/input/misc/vd6281/vd6281_module.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,10 @@
#define VIO_VOLTAGE_MAX 1800000
#define VDD_VOlTAGE_MIN 1900000
#define VDD_VOlTAGE_MAX 1900000
#define PMIC_BUCK1_VOlTAGE_MIN 1350000
#define PMIC_BUCK1_VOlTAGE_MAX 1350000
#define PMIC_BUCK2_VOlTAGE_MIN 3237500
#define PMIC_BUCK2_VOlTAGE_MAX 4100000

enum RAINBOW_POWER {
REGULATOR_VIO,
REGULATOR_VDD,
REGULATOR_BUCK1,
REGULATOR_BUCK2,
POWER_MAX
};

Expand All @@ -53,8 +47,6 @@ struct rainbow_ctrl_t {
struct camera_io_master io_master_info;
struct regulator *vdd;
struct regulator *vio;
struct regulator *buck1;
struct regulator *buck2;
dev_t dev;
bool is_cci_init;
bool is_power_up[POWER_MAX];
Expand Down Expand Up @@ -132,42 +124,6 @@ static int vd6281_power_up(struct rainbow_ctrl_t *ctrl)
{
int rc;

if (!ctrl->is_power_up[REGULATOR_BUCK1]) {
rc = regulator_set_voltage(ctrl->buck1,
PMIC_BUCK1_VOlTAGE_MIN, PMIC_BUCK1_VOlTAGE_MAX);
if (rc < 0) {
dev_err(ctrl->soc_info.dev,
"set buck1 voltage failed: %d", rc);
return rc;
}
rc = regulator_enable(ctrl->buck1);
if (rc < 0) {
dev_err(ctrl->soc_info.dev,
"%s buck1 regulator_enable failed: rc: %d",
__func__, rc);
return rc;
}
ctrl->is_power_up[REGULATOR_BUCK1] = true;
}

if (!ctrl->is_power_up[REGULATOR_BUCK2]) {
rc = regulator_set_voltage(ctrl->buck2,
PMIC_BUCK2_VOlTAGE_MIN, PMIC_BUCK2_VOlTAGE_MAX);
if (rc < 0) {
dev_err(ctrl->soc_info.dev,
"set buck2 voltage failed: %d", rc);
return rc;
}
rc = regulator_enable(ctrl->buck2);
if (rc < 0) {
dev_err(ctrl->soc_info.dev,
"%s buck2 regulator_enable failed: rc: %d",
__func__, rc);
return rc;
}
ctrl->is_power_up[REGULATOR_BUCK2] = true;
}

if (!ctrl->is_power_up[REGULATOR_VDD]) {
rc = regulator_set_voltage(ctrl->vdd,
VDD_VOlTAGE_MIN, VDD_VOlTAGE_MAX);
Expand Down Expand Up @@ -256,30 +212,6 @@ static int vd6281_power_down(struct rainbow_ctrl_t *ctrl)
ctrl->is_power_up[REGULATOR_VIO] = false;
}

if (ctrl->is_power_up[REGULATOR_BUCK2]) {
is_error = regulator_set_voltage(
ctrl->buck2, 0, PMIC_BUCK2_VOlTAGE_MAX) +
regulator_disable(ctrl->buck2);
if (is_error < 0) {
rc = is_error;
dev_err(ctrl->soc_info.dev,
"%s buck2 regulator_disable failed: rc: %d",
__func__, rc);
} else
ctrl->is_power_up[REGULATOR_BUCK2] = false;
}

if (ctrl->is_power_up[REGULATOR_BUCK1]) {
is_error = regulator_disable(ctrl->buck1);
if (is_error < 0) {
rc = is_error;
dev_err(ctrl->soc_info.dev,
"%s buck1 regulator_disable failed: rc: %d",
__func__, rc);
} else
ctrl->is_power_up[REGULATOR_BUCK1] = false;
}

return rc;
}

Expand All @@ -293,8 +225,6 @@ static ssize_t rainbow_enable_show(struct device *dev,
mutex_lock(&ctrl->cam_sensor_mutex);
is_enabled = (ctrl->is_power_up[REGULATOR_VDD] &&
ctrl->is_power_up[REGULATOR_VDD] &&
ctrl->is_power_up[REGULATOR_BUCK1] &&
ctrl->is_power_up[REGULATOR_BUCK2] &&
ctrl->is_cci_init);
mutex_unlock(&ctrl->cam_sensor_mutex);

Expand Down Expand Up @@ -351,8 +281,6 @@ static ssize_t rainbow_read_byte_store(struct device *dev,
mutex_lock(&ctrl->cam_sensor_mutex);
if (!(ctrl->is_power_up[REGULATOR_VDD] &&
ctrl->is_power_up[REGULATOR_VIO] &&
ctrl->is_power_up[REGULATOR_BUCK1] &&
ctrl->is_power_up[REGULATOR_BUCK2] &&
ctrl->is_cci_init)) {
rc = -EINVAL;
goto error_out;
Expand Down Expand Up @@ -394,8 +322,6 @@ static ssize_t rainbow_write_byte_store(struct device *dev,
mutex_lock(&ctrl->cam_sensor_mutex);
if (!(ctrl->is_power_up[REGULATOR_VDD] &&
ctrl->is_power_up[REGULATOR_VIO] &&
ctrl->is_power_up[REGULATOR_BUCK1] &&
ctrl->is_power_up[REGULATOR_BUCK2] &&
ctrl->is_cci_init)) {
rc = -EINVAL;
goto error_out;
Expand Down Expand Up @@ -489,20 +415,6 @@ static int vd6281_parse_dt(struct device *dev)
rc = -ENOENT;
}

ctrl->buck1 = devm_regulator_get(dev, "pmic_buck1");
if (IS_ERR(ctrl->buck1)) {
ctrl->buck1 = NULL;
dev_err(dev, "unable to get pmic buck1");
rc = -ENOENT;
}

ctrl->buck2 = devm_regulator_get(dev, "pmic_buck2");
if (IS_ERR(ctrl->buck2)) {
ctrl->buck2 = NULL;
dev_err(dev, "unable to get pmic buck2");
rc = -ENOENT;
}

return rc;
}

Expand Down Expand Up @@ -555,8 +467,6 @@ static int32_t vd6281_driver_platform_probe(
ctrl->io_master_info.master_type = CCI_MASTER;
ctrl->is_power_up[REGULATOR_VIO] = false;
ctrl->is_power_up[REGULATOR_VDD] = false;
ctrl->is_power_up[REGULATOR_BUCK1] = false;
ctrl->is_power_up[REGULATOR_BUCK2] = false;
ctrl->is_cci_init = false;
ctrl->is_probed = false;

Expand Down Expand Up @@ -674,6 +584,7 @@ static int vd6281_open(struct inode *inode, struct file *file)

static int vd6281_release(struct inode *inode, struct file *file)
{
vd6281_power_down(ctrl);
return 0;
}

Expand Down
3 changes: 1 addition & 2 deletions drivers/media/platform/msm/camera/cam_isp/cam_isp_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,7 @@
static struct cam_isp_dev g_isp_dev;

static void cam_isp_dev_stop_all_dev(
struct cam_node *node
)
struct cam_node *node)
{
int i = 0;
struct cam_hw_stop_args stop_args;
Expand Down
4 changes: 2 additions & 2 deletions drivers/misc/faceauth_hypx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ int el2_gather_debug_data(struct device *dev, void *destination_buffer,

ret = desc.ret[0];
if (ret) {
ret = parse_el2_return(ret);
err = parse_el2_return(ret);
goto exit;
}

Expand Down Expand Up @@ -1361,7 +1361,7 @@ int el2_gather_debug_data(struct device *dev, void *destination_buffer,

ret = desc.ret[0];
if (ret) {
ret = parse_el2_return(ret);
err = parse_el2_return(ret);
goto exit;
}

Expand Down
6 changes: 4 additions & 2 deletions drivers/misc/ipu/ipu-core-jqs-msg-transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -762,7 +762,7 @@ ssize_t ipu_core_jqs_msg_transport_user_read(struct paintbox_bus *bus,

trans = ipu_core_get_jqs_transport(bus);
if (IS_ERR(trans)) {
if(bus->jqs_msg_transport) {
if (bus->jqs_msg_transport) {
spin_lock_irqsave(&bus->irq_lock, flags);
waiter->enabled = false;
spin_unlock_irqrestore(&bus->irq_lock, flags);
Expand Down Expand Up @@ -1037,7 +1037,7 @@ ssize_t ipu_core_jqs_msg_transport_kernel_write_sync(struct paintbox_bus *bus,
timeout = wait_for_completion_timeout(&waiter->completion, timeout);

/* A message error has higher priority than a timeout error. */
if (waiter->ret)
if (waiter->ret < 0)
ret = waiter->ret;
else if (timeout == 0)
ret = -ETIMEDOUT;
Expand All @@ -1046,6 +1046,8 @@ ssize_t ipu_core_jqs_msg_transport_kernel_write_sync(struct paintbox_bus *bus,

trans = ipu_core_get_jqs_transport(bus);
if (IS_ERR(trans)) {
if (bus->jqs_msg_transport)
waiter->enabled = false;
mutex_unlock(&bus->transport_lock);
return PTR_ERR(trans);
}
Expand Down

0 comments on commit d678237

Please sign in to comment.