Skip to content

Instantly share code, notes, and snippets.

@invisiblek
Created April 1, 2015 00:13
Show Gist options
  • Save invisiblek/c73419b0cd77b0884e51 to your computer and use it in GitHub Desktop.
Save invisiblek/c73419b0cd77b0884e51 to your computer and use it in GitHub Desktop.
diff --git a/drivers/thermal/qpnp-adc-tm.c b/drivers/thermal/qpnp-adc-tm.c
index eb647fa..8a3f6a3 100644
--- a/drivers/thermal/qpnp-adc-tm.c
+++ b/drivers/thermal/qpnp-adc-tm.c
@@ -209,6 +209,7 @@ struct qpnp_adc_tm_chip {
struct work_struct trigger_high_thr_work;
struct work_struct trigger_low_thr_work;
struct qpnp_adc_tm_sensor sensor[0];
+ bool usb_id_ext_pull_up;
};
LIST_HEAD(qpnp_adc_tm_device_list);
@@ -1795,7 +1796,11 @@ EXPORT_SYMBOL(qpnp_adc_tm_disable_chan_meas);
int32_t qpnp_adc_tm_usbid_configure(struct qpnp_adc_tm_chip *chip,
struct qpnp_adc_tm_btm_param *param)
{
- param->channel = LR_MUX10_PU2_AMUX_USB_ID_LV;
+ if (chip->usb_id_ext_pull_up)
+ param->channel = LR_MUX10_USB_ID_LV;
+ else
+ param->channel = LR_MUX10_PU2_AMUX_USB_ID_LV;
+
return qpnp_adc_tm_channel_measure(chip, param);
}
EXPORT_SYMBOL(qpnp_adc_tm_usbid_configure);
@@ -1988,6 +1993,9 @@ static int __devinit qpnp_adc_tm_probe(struct spmi_device *spmi)
goto fail;
}
+ chip->usb_id_ext_pull_up = of_property_read_bool(node,
+ "usb-id-ext-pull-up");
+
rc = devm_request_irq(&spmi->dev, chip->adc->adc_high_thr_irq,
qpnp_adc_tm_high_thr_isr,
IRQF_TRIGGER_RISING, "qpnp_adc_tm_high_interrupt", chip);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment