From 22ba2185dab87dd8da9bdb72f6aac257c707a082 Mon Sep 17 00:00:00 2001 From: Phani Kumar Uppalapati Date: Tue, 22 Mar 2016 21:16:44 -0700 Subject: soundwire: Add API to control slave device data path Add soundwire API to control slave device data path enable or disable. This gives slave device drivers more flexibility for data path control during device path enablement. CRs-fixed: 996586 Change-Id: Ic0ab015098035418458a5ba7c2ffad9df20f933c Signed-off-by: Phani Kumar Uppalapati --- include/linux/soundwire/soundwire.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'include/linux') diff --git a/include/linux/soundwire/soundwire.h b/include/linux/soundwire/soundwire.h index f19e871d6ac2..4b957245209e 100755 --- a/include/linux/soundwire/soundwire.h +++ b/include/linux/soundwire/soundwire.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2015, The Linux Foundation. All rights reserved. +/* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -151,6 +151,7 @@ struct swr_master { const void *buf, size_t len); int (*get_logical_dev_num)(struct swr_master *mstr, u64 dev_id, u8 *dev_num); + void (*slvdev_datapath_control)(struct swr_master *mstr, bool enable); }; static inline struct swr_master *to_swr_master(struct device *dev) @@ -304,4 +305,6 @@ extern int swr_device_down(struct swr_device *swr_dev); extern int swr_reset_device(struct swr_device *swr_dev); +extern int swr_slvdev_datapath_control(struct swr_device *swr_dev, u8 dev_num, + bool enable); #endif /* _LINUX_SOUNDWIRE_H */ -- cgit v1.2.3 From 27f3e78625e59e1b31d8e4f08ff23e142295189e Mon Sep 17 00:00:00 2001 From: Jack Pham Date: Mon, 29 Feb 2016 11:41:58 -0800 Subject: power_supply: Add additional USB Type-C properties Introduce the power_supply_typec_mode enum definitions which will allow a charger to indicate the type of USB Type-C connection that is established. Also add additional properties for indicating CC pin orientation, changing source/sink power role (useful for dynamic power role swap), and a flag to allow the charger to expect VBUS changes during USB Power Delivery power negotiation. CRs-Fixed: 1005389 Change-Id: Iba9b652335fba4ee4f24a17eba8abdd5c85c21bb Signed-off-by: Jack Pham Signed-off-by: Nicholas Troast --- include/linux/power_supply.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'include/linux') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 376645983d3e..6ccfe7a8de41 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -209,6 +209,10 @@ enum power_supply_property { POWER_SUPPLY_PROP_RESTRICTED_CHARGING, POWER_SUPPLY_PROP_CURRENT_CAPABILITY, POWER_SUPPLY_PROP_TYPEC_MODE, + POWER_SUPPLY_PROP_TYPEC_CC_ORIENTATION, /* 0: N/C, 1: CC1, 2: CC2 */ + POWER_SUPPLY_PROP_TYPEC_POWER_ROLE, + POWER_SUPPLY_PROP_PD_ALLOWED, + POWER_SUPPLY_PROP_PD_ACTIVE, /* Local extensions of type int64_t */ POWER_SUPPLY_PROP_CHARGE_COUNTER_EXT, /* Properties of type `const char *' */ @@ -229,6 +233,7 @@ enum power_supply_type { POWER_SUPPLY_TYPE_USB_ACA, /* Accessory Charger Adapters */ POWER_SUPPLY_TYPE_USB_HVDCP, /* High Voltage DCP */ POWER_SUPPLY_TYPE_USB_HVDCP_3, /* Efficient High Voltage DCP */ + POWER_SUPPLY_TYPE_USB_PD, /* Power Delivery */ POWER_SUPPLY_TYPE_WIRELESS, /* Accessory Charger Adapters */ POWER_SUPPLY_TYPE_BMS, /* Battery Monitor System */ POWER_SUPPLY_TYPE_USB_PARALLEL, /* USB Parallel Path */ @@ -238,6 +243,31 @@ enum power_supply_type { POWER_SUPPLY_TYPE_DFP, /* TYpe-C DFP */ }; +/* Indicates USB Type-C CC connection status */ +enum power_supply_typec_mode { + POWER_SUPPLY_TYPEC_NONE, + + /* Acting as source */ + POWER_SUPPLY_TYPEC_SINK, /* Rd only */ + POWER_SUPPLY_TYPEC_SINK_POWERED_CABLE, /* Rd/Ra */ + POWER_SUPPLY_TYPEC_SINK_DEBUG_ACCESSORY, /* Rd/Rd */ + POWER_SUPPLY_TYPEC_SINK_AUDIO_ADAPTER, /* Ra/Ra */ + POWER_SUPPLY_TYPEC_POWERED_CABLE_ONLY, /* Ra only */ + + /* Acting as sink */ + POWER_SUPPLY_TYPEC_SOURCE_DEFAULT, /* Rp default */ + POWER_SUPPLY_TYPEC_SOURCE_MEDIUM, /* Rp 1.5A */ + POWER_SUPPLY_TYPEC_SOURCE_HIGH, /* Rp 3A */ + POWER_SUPPLY_TYPEC_NON_COMPLIANT, +}; + +enum power_supply_typec_power_role { + POWER_SUPPLY_TYPEC_PR_NONE, /* CC lines in high-Z */ + POWER_SUPPLY_TYPEC_PR_DUAL, + POWER_SUPPLY_TYPEC_PR_SINK, + POWER_SUPPLY_TYPEC_PR_SOURCE, +}; + enum power_supply_notifier_events { PSY_EVENT_PROP_CHANGED, }; -- cgit v1.2.3 From 4e468402df857c050dc5ebb287411d14fae5221d Mon Sep 17 00:00:00 2001 From: Nicholas Troast Date: Fri, 1 Apr 2016 10:48:01 -0700 Subject: power_supply: add INPUT_SUSPEND power supply property POWER_SUPPLY_PROP_CHARGING_ENABLED has been used to indicate enabling the charge path in some drivers and enabling the input path in others. This leads to confusion of what charging enabled really means. POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED was introduced to indicate enabling the charge path, and in this case POWER_SUPPLY_PROP_CHARGING_ENABLED is used to indicate enabling the input path. Since these are similarly named it leads to even more confusion. In an attempt to fix this confusion we introduce a new power supply property POWER_SUPPLY_PROP_INPUT_SUSPEND which indicates suspending the input path of the power supply. POWER_SUPPLY_PROP_CHARGING_ENABLED takes its original definition of enabling the charge path. Then POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED will be retired from use. CRs-Fixed: 1005389 Change-Id: I1ca8f5748a56a9395caa8ed8ed18f70e69f0cbe8 Signed-off-by: Nicholas Troast --- include/linux/power_supply.h | 1 + 1 file changed, 1 insertion(+) (limited to 'include/linux') diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h index 6ccfe7a8de41..b081a56e250f 100644 --- a/include/linux/power_supply.h +++ b/include/linux/power_supply.h @@ -177,6 +177,7 @@ enum power_supply_property { POWER_SUPPLY_PROP_CHARGE_ENABLED, POWER_SUPPLY_PROP_BATTERY_CHARGING_ENABLED, POWER_SUPPLY_PROP_CHARGING_ENABLED, + POWER_SUPPLY_PROP_INPUT_SUSPEND, POWER_SUPPLY_PROP_INPUT_VOLTAGE_REGULATION, POWER_SUPPLY_PROP_INPUT_CURRENT_MAX, POWER_SUPPLY_PROP_INPUT_CURRENT_TRIM, -- cgit v1.2.3 From 0443c0f276fb0c96213ca0f771fcf9c8602ade92 Mon Sep 17 00:00:00 2001 From: Skylar Chang Date: Wed, 4 May 2016 23:10:48 -0700 Subject: msm: ipa3: enable rndis_ipa on msm-4.4 Change the feature flag to compile rndis_ipa on cobalt target with msm-4.4 kernel, also fix the compile warnings. Change-Id: I82d3dd00e003d8eab63ca6bcc3bb91d51f122606 Signed-off-by: Skylar Chang --- include/linux/rndis_ipa.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'include/linux') diff --git a/include/linux/rndis_ipa.h b/include/linux/rndis_ipa.h index c9e389ddbf2b..9dcb8c30901b 100644 --- a/include/linux/rndis_ipa.h +++ b/include/linux/rndis_ipa.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. +/* Copyright (c) 2013-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -75,7 +75,7 @@ void rndis_ipa_cleanup(void *private); static inline int rndis_ipa_init(struct ipa_usb_init_params *params) { - return 0; + return -ENOMEM; } static inline int rndis_ipa_pipe_connect_notify(u32 usb_to_ipa_hdl, @@ -85,12 +85,12 @@ static inline int rndis_ipa_pipe_connect_notify(u32 usb_to_ipa_hdl, u32 max_xfer_size_bytes_to_host, void *private) { - return 0; + return -ENOMEM; } static inline int rndis_ipa_pipe_disconnect_notify(void *private) { - return 0; + return -ENOMEM; } static inline void rndis_ipa_cleanup(void *private) -- cgit v1.2.3 From 81a5895080b012100d7e7f8cda695489734ee07a Mon Sep 17 00:00:00 2001 From: Siddartha Mohanadoss Date: Thu, 28 Apr 2016 14:12:44 -0700 Subject: thermal: qpnp-adc-tm: Support refreshed BTM driver The BTM (Battery temperature module) peripheral driver on the PMIC (Power management IC) supports threshold monitoring and notifies clients when thresholds are crossed. PMCOBALT supports refreshed BTM peripheral register interface and the driver uses compatible property qpnp-adc-tm-hc to distinguish using the refreshed peripheral. The external client interface with the driver remains the same. Updates include handling the interrupt when the thresholds are crossed,programming the threholds and configuring the hardware based on the refreshed design. BTM peripheral needs the VADC_HC peripheral to compute the gain/offset that are used to reverse compute the threhold values to ADC code. Some of the reverse computation API's such as calculating thermistor thresholds require the gain and offset values before computing the ADC code to be programmed. This requires modification to the existing calibration API in the VADC_HC driver to calculate the reference calibration points and store these values for clients to use in the reverse computation Change-Id: I989cfa4f40e7f1671f04dfa9d4c3fe2ccbbc44ab Signed-off-by: Siddartha Mohanadoss --- include/linux/qpnp/qpnp-adc.h | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) (limited to 'include/linux') diff --git a/include/linux/qpnp/qpnp-adc.h b/include/linux/qpnp/qpnp-adc.h index e143b93ce020..8d51ddcd4246 100644 --- a/include/linux/qpnp/qpnp-adc.h +++ b/include/linux/qpnp/qpnp-adc.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2012-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -1062,7 +1062,7 @@ struct qpnp_vadc_chan_properties { enum qpnp_adc_tm_channel_select tm_channel_select; enum qpnp_state_request state_request; enum qpnp_adc_calib_type calib_type; - struct qpnp_vadc_linear_graph adc_graph[2]; + struct qpnp_vadc_linear_graph adc_graph[ADC_HC_CAL_SEL_NONE]; }; /** @@ -1243,6 +1243,10 @@ struct qpnp_adc_drv { * @fast_avg_setup - Ability to provide single result from the ADC * that is an average of multiple measurements. * @trigger_channel - HW trigger channel for conversion sequencer. + * @calib_type - Used to store the calibration type for the channel + * absolute/ratiometric. + * @cal_val - Used to determine if fresh calibration value or timer + * updated calibration value is to be used. * @chan_prop - Represent the channel properties of the ADC. */ struct qpnp_adc_amux_properties { @@ -1252,6 +1256,8 @@ struct qpnp_adc_amux_properties { uint32_t hw_settle_time; uint32_t fast_avg_setup; enum qpnp_vadc_trigger trigger_channel; + enum qpnp_adc_calib_type calib_type; + enum qpnp_adc_cal_val cal_val; struct qpnp_vadc_chan_properties chan_prop[0]; }; @@ -1683,19 +1689,25 @@ int32_t qpnp_adc_qrd_skut1_btm_scaler(struct qpnp_vadc_chip *dev, * and convert given temperature to voltage on supported * thermistor channels using 100k pull-up. * @dev: Structure device for qpnp vadc + * @adc_prop: adc properties of the qpnp adc such as bit resolution, + * reference voltage. * @param: The input temperature values. */ int32_t qpnp_adc_tm_scale_therm_voltage_pu2(struct qpnp_vadc_chip *dev, + const struct qpnp_adc_properties *adc_properties, struct qpnp_adc_tm_config *param); /** * qpnp_adc_tm_scale_therm_voltage_pu2() - Performs reverse calibration * and converts the given ADC code to temperature for * thermistor channels using 100k pull-up. * @dev: Structure device for qpnp vadc + * @adc_prop: adc properties of the qpnp adc such as bit resolution, + * reference voltage. * @reg: The input ADC code. * @result: The physical measurement temperature on the thermistor. */ int32_t qpnp_adc_tm_scale_voltage_therm_pu2(struct qpnp_vadc_chip *dev, + const struct qpnp_adc_properties *adc_prop, uint32_t reg, int64_t *result); /** * qpnp_adc_usb_scaler() - Performs reverse calibration on the low/high @@ -2017,11 +2029,13 @@ static inline int32_t qpnp_adc_scale_millidegc_pmic_voltage_thr( { return -ENXIO; } static inline int32_t qpnp_adc_tm_scale_therm_voltage_pu2( struct qpnp_vadc_chip *dev, + const struct qpnp_adc_properties *adc_properties, struct qpnp_adc_tm_config *param) { return -ENXIO; } static inline int32_t qpnp_adc_tm_scale_voltage_therm_pu2( struct qpnp_vadc_chip *dev, - uint32_t reg, int64_t *result) + const struct qpnp_adc_properties *adc_prop, + uint32_t reg, int64_t *result) { return -ENXIO; } static inline int32_t qpnp_adc_smb_btm_rscaler(struct qpnp_vadc_chip *dev, struct qpnp_adc_tm_btm_param *param, -- cgit v1.2.3