diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 14:08:17 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-09-05 14:08:17 -0400 |
| commit | bafb0762cb6a906eb4105cccfb3bcd90be7f40d2 (patch) | |
| tree | 14ecb87c33bcf909e5b95c27cd694ded4ac1478c /include/linux | |
| parent | 44b1671fae88ce95b8c7b53acbc6ba71ca67db00 (diff) | |
| parent | 3a6430ce462172caac7c73f4afd550ab0f105737 (diff) | |
Merge tag 'char-misc-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver updates from Greg KH:
"Here is the big char/misc driver update for 4.14-rc1.
Lots of different stuff in here, it's been an active development cycle
for some reason. Highlights are:
- updated binder driver, this brings binder up to date with what
shipped in the Android O release, plus some more changes that
happened since then that are in the Android development trees.
- coresight updates and fixes
- mux driver file renames to be a bit "nicer"
- intel_th driver updates
- normal set of hyper-v updates and changes
- small fpga subsystem and driver updates
- lots of const code changes all over the driver trees
- extcon driver updates
- fmc driver subsystem upadates
- w1 subsystem minor reworks and new features and drivers added
- spmi driver updates
Plus a smattering of other minor driver updates and fixes.
All of these have been in linux-next with no reported issues for a
while"
* tag 'char-misc-4.14-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (244 commits)
ANDROID: binder: don't queue async transactions to thread.
ANDROID: binder: don't enqueue death notifications to thread todo.
ANDROID: binder: Don't BUG_ON(!spin_is_locked()).
ANDROID: binder: Add BINDER_GET_NODE_DEBUG_INFO ioctl
ANDROID: binder: push new transactions to waiting threads.
ANDROID: binder: remove proc waitqueue
android: binder: Add page usage in binder stats
android: binder: fixup crash introduced by moving buffer hdr
drivers: w1: add hwmon temp support for w1_therm
drivers: w1: refactor w1_slave_show to make the temp reading functionality separate
drivers: w1: add hwmon support structures
eeprom: idt_89hpesx: Support both ACPI and OF probing
mcb: Fix an error handling path in 'chameleon_parse_cells()'
MCB: add support for SC31 to mcb-lpc
mux: make device_type const
char: virtio: constify attribute_group structures.
Documentation/ABI: document the nvmem sysfs files
lkdtm: fix spelling mistake: "incremeted" -> "incremented"
perf: cs-etm: Fix ETMv4 CONFIGR entry in perf.data file
nvmem: include linux/err.h from header
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/bitrev.h | 19 | ||||
| -rw-r--r-- | include/linux/coresight-pmu.h | 6 | ||||
| -rw-r--r-- | include/linux/eeprom_93xx46.h | 3 | ||||
| -rw-r--r-- | include/linux/extcon.h | 130 | ||||
| -rw-r--r-- | include/linux/fmc.h | 39 | ||||
| -rw-r--r-- | include/linux/fpga/fpga-mgr.h | 4 | ||||
| -rw-r--r-- | include/linux/fs.h | 10 | ||||
| -rw-r--r-- | include/linux/hyperv.h | 67 | ||||
| -rw-r--r-- | include/linux/mfd/cros_ec_commands.h | 75 | ||||
| -rw-r--r-- | include/linux/mfd/ds1wm.h | 29 | ||||
| -rw-r--r-- | include/linux/mux/consumer.h | 2 | ||||
| -rw-r--r-- | include/linux/nvmem-consumer.h | 10 | ||||
| -rw-r--r-- | include/linux/w1.h | 4 |
13 files changed, 242 insertions, 156 deletions
diff --git a/include/linux/bitrev.h b/include/linux/bitrev.h index fb790b8449c1..b97be27e5a85 100644 --- a/include/linux/bitrev.h +++ b/include/linux/bitrev.h | |||
| @@ -29,6 +29,8 @@ static inline u32 __bitrev32(u32 x) | |||
| 29 | 29 | ||
| 30 | #endif /* CONFIG_HAVE_ARCH_BITREVERSE */ | 30 | #endif /* CONFIG_HAVE_ARCH_BITREVERSE */ |
| 31 | 31 | ||
| 32 | #define __bitrev8x4(x) (__bitrev32(swab32(x))) | ||
| 33 | |||
| 32 | #define __constant_bitrev32(x) \ | 34 | #define __constant_bitrev32(x) \ |
| 33 | ({ \ | 35 | ({ \ |
| 34 | u32 __x = x; \ | 36 | u32 __x = x; \ |
| @@ -50,6 +52,15 @@ static inline u32 __bitrev32(u32 x) | |||
| 50 | __x; \ | 52 | __x; \ |
| 51 | }) | 53 | }) |
| 52 | 54 | ||
| 55 | #define __constant_bitrev8x4(x) \ | ||
| 56 | ({ \ | ||
| 57 | u32 __x = x; \ | ||
| 58 | __x = ((__x & (u32)0xF0F0F0F0UL) >> 4) | ((__x & (u32)0x0F0F0F0FUL) << 4); \ | ||
| 59 | __x = ((__x & (u32)0xCCCCCCCCUL) >> 2) | ((__x & (u32)0x33333333UL) << 2); \ | ||
| 60 | __x = ((__x & (u32)0xAAAAAAAAUL) >> 1) | ((__x & (u32)0x55555555UL) << 1); \ | ||
| 61 | __x; \ | ||
| 62 | }) | ||
| 63 | |||
| 53 | #define __constant_bitrev8(x) \ | 64 | #define __constant_bitrev8(x) \ |
| 54 | ({ \ | 65 | ({ \ |
| 55 | u8 __x = x; \ | 66 | u8 __x = x; \ |
| @@ -75,6 +86,14 @@ static inline u32 __bitrev32(u32 x) | |||
| 75 | __bitrev16(__x); \ | 86 | __bitrev16(__x); \ |
| 76 | }) | 87 | }) |
| 77 | 88 | ||
| 89 | #define bitrev8x4(x) \ | ||
| 90 | ({ \ | ||
| 91 | u32 __x = x; \ | ||
| 92 | __builtin_constant_p(__x) ? \ | ||
| 93 | __constant_bitrev8x4(__x) : \ | ||
| 94 | __bitrev8x4(__x); \ | ||
| 95 | }) | ||
| 96 | |||
| 78 | #define bitrev8(x) \ | 97 | #define bitrev8(x) \ |
| 79 | ({ \ | 98 | ({ \ |
| 80 | u8 __x = x; \ | 99 | u8 __x = x; \ |
diff --git a/include/linux/coresight-pmu.h b/include/linux/coresight-pmu.h index 7d410260661b..edfeaba95429 100644 --- a/include/linux/coresight-pmu.h +++ b/include/linux/coresight-pmu.h | |||
| @@ -24,6 +24,12 @@ | |||
| 24 | /* ETMv3.5/PTM's ETMCR config bit */ | 24 | /* ETMv3.5/PTM's ETMCR config bit */ |
| 25 | #define ETM_OPT_CYCACC 12 | 25 | #define ETM_OPT_CYCACC 12 |
| 26 | #define ETM_OPT_TS 28 | 26 | #define ETM_OPT_TS 28 |
| 27 | #define ETM_OPT_RETSTK 29 | ||
| 28 | |||
| 29 | /* ETMv4 CONFIGR programming bits for the ETM OPTs */ | ||
| 30 | #define ETM4_CFG_BIT_CYCACC 4 | ||
| 31 | #define ETM4_CFG_BIT_TS 11 | ||
| 32 | #define ETM4_CFG_BIT_RETSTK 12 | ||
| 27 | 33 | ||
| 28 | static inline int coresight_get_trace_id(int cpu) | 34 | static inline int coresight_get_trace_id(int cpu) |
| 29 | { | 35 | { |
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h index 885f587a3555..915898759280 100644 --- a/include/linux/eeprom_93xx46.h +++ b/include/linux/eeprom_93xx46.h | |||
| @@ -2,8 +2,7 @@ | |||
| 2 | * Module: eeprom_93xx46 | 2 | * Module: eeprom_93xx46 |
| 3 | * platform description for 93xx46 EEPROMs. | 3 | * platform description for 93xx46 EEPROMs. |
| 4 | */ | 4 | */ |
| 5 | 5 | #include <linux/gpio/consumer.h> | |
| 6 | struct gpio_desc; | ||
| 7 | 6 | ||
| 8 | struct eeprom_93xx46_platform_data { | 7 | struct eeprom_93xx46_platform_data { |
| 9 | unsigned char flags; | 8 | unsigned char flags; |
diff --git a/include/linux/extcon.h b/include/linux/extcon.h index 7e206a9f88db..744d60ca80c3 100644 --- a/include/linux/extcon.h +++ b/include/linux/extcon.h | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * External connector (extcon) class driver | 2 | * External Connector (extcon) framework |
| 3 | * | 3 | * |
| 4 | * Copyright (C) 2015 Samsung Electronics | 4 | * Copyright (C) 2015 Samsung Electronics |
| 5 | * Author: Chanwoo Choi <cw00.choi@samsung.com> | 5 | * Author: Chanwoo Choi <cw00.choi@samsung.com> |
| @@ -20,8 +20,7 @@ | |||
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. | 22 | * GNU General Public License for more details. |
| 23 | * | 23 | */ |
| 24 | */ | ||
| 25 | 24 | ||
| 26 | #ifndef __LINUX_EXTCON_H__ | 25 | #ifndef __LINUX_EXTCON_H__ |
| 27 | #define __LINUX_EXTCON_H__ | 26 | #define __LINUX_EXTCON_H__ |
| @@ -93,7 +92,7 @@ | |||
| 93 | #define EXTCON_NUM 63 | 92 | #define EXTCON_NUM 63 |
| 94 | 93 | ||
| 95 | /* | 94 | /* |
| 96 | * Define the property of supported external connectors. | 95 | * Define the properties of supported external connectors. |
| 97 | * | 96 | * |
| 98 | * When adding the new extcon property, they *must* have | 97 | * When adding the new extcon property, they *must* have |
| 99 | * the type/value/default information. Also, you *have to* | 98 | * the type/value/default information. Also, you *have to* |
| @@ -176,44 +175,42 @@ struct extcon_dev; | |||
| 176 | 175 | ||
| 177 | #if IS_ENABLED(CONFIG_EXTCON) | 176 | #if IS_ENABLED(CONFIG_EXTCON) |
| 178 | 177 | ||
| 179 | /* | 178 | /* Following APIs register/unregister the extcon device. */ |
| 180 | * Following APIs are for notifiers or configurations. | ||
| 181 | * Notifiers are the external port and connection devices. | ||
| 182 | */ | ||
| 183 | extern int extcon_dev_register(struct extcon_dev *edev); | 179 | extern int extcon_dev_register(struct extcon_dev *edev); |
| 184 | extern void extcon_dev_unregister(struct extcon_dev *edev); | 180 | extern void extcon_dev_unregister(struct extcon_dev *edev); |
| 185 | extern int devm_extcon_dev_register(struct device *dev, | 181 | extern int devm_extcon_dev_register(struct device *dev, |
| 186 | struct extcon_dev *edev); | 182 | struct extcon_dev *edev); |
| 187 | extern void devm_extcon_dev_unregister(struct device *dev, | 183 | extern void devm_extcon_dev_unregister(struct device *dev, |
| 188 | struct extcon_dev *edev); | 184 | struct extcon_dev *edev); |
| 189 | extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); | ||
| 190 | 185 | ||
| 191 | /* | 186 | /* Following APIs allocate/free the memory of the extcon device. */ |
| 192 | * Following APIs control the memory of extcon device. | ||
| 193 | */ | ||
| 194 | extern struct extcon_dev *extcon_dev_allocate(const unsigned int *cable); | 187 | extern struct extcon_dev *extcon_dev_allocate(const unsigned int *cable); |
| 195 | extern void extcon_dev_free(struct extcon_dev *edev); | 188 | extern void extcon_dev_free(struct extcon_dev *edev); |
| 196 | extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, | 189 | extern struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, |
| 197 | const unsigned int *cable); | 190 | const unsigned int *cable); |
| 198 | extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev); | 191 | extern void devm_extcon_dev_free(struct device *dev, struct extcon_dev *edev); |
| 199 | 192 | ||
| 193 | /* Synchronize the state and property value for each external connector. */ | ||
| 194 | extern int extcon_sync(struct extcon_dev *edev, unsigned int id); | ||
| 195 | |||
| 200 | /* | 196 | /* |
| 201 | * get/set_state access each bit of the 32b encoded state value. | 197 | * Following APIs get/set the connected state of each external connector. |
| 202 | * They are used to access the status of each cable based on the cable id. | 198 | * The 'id' argument indicates the defined external connector. |
| 203 | */ | 199 | */ |
| 204 | extern int extcon_get_state(struct extcon_dev *edev, unsigned int id); | 200 | extern int extcon_get_state(struct extcon_dev *edev, unsigned int id); |
| 205 | extern int extcon_set_state(struct extcon_dev *edev, unsigned int id, | 201 | extern int extcon_set_state(struct extcon_dev *edev, unsigned int id, |
| 206 | bool cable_state); | 202 | bool state); |
| 207 | extern int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, | 203 | extern int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, |
| 208 | bool cable_state); | 204 | bool state); |
| 209 | /* | ||
| 210 | * Synchronize the state and property data for a specific external connector. | ||
| 211 | */ | ||
| 212 | extern int extcon_sync(struct extcon_dev *edev, unsigned int id); | ||
| 213 | 205 | ||
| 214 | /* | 206 | /* |
| 215 | * get/set_property access the property value of each external connector. | 207 | * Following APIs get/set the property of each external connector. |
| 216 | * They are used to access the property of each cable based on the property id. | 208 | * The 'id' argument indicates the defined external connector |
| 209 | * and the 'prop' indicates the extcon property. | ||
| 210 | * | ||
| 211 | * And extcon_get/set_property_capability() set the capability of the property | ||
| 212 | * for each external connector. They are used to set the capability of the | ||
| 213 | * property of each external connector based on the id and property. | ||
| 217 | */ | 214 | */ |
| 218 | extern int extcon_get_property(struct extcon_dev *edev, unsigned int id, | 215 | extern int extcon_get_property(struct extcon_dev *edev, unsigned int id, |
| 219 | unsigned int prop, | 216 | unsigned int prop, |
| @@ -224,28 +221,24 @@ extern int extcon_set_property(struct extcon_dev *edev, unsigned int id, | |||
| 224 | extern int extcon_set_property_sync(struct extcon_dev *edev, unsigned int id, | 221 | extern int extcon_set_property_sync(struct extcon_dev *edev, unsigned int id, |
| 225 | unsigned int prop, | 222 | unsigned int prop, |
| 226 | union extcon_property_value prop_val); | 223 | union extcon_property_value prop_val); |
| 227 | |||
| 228 | /* | ||
| 229 | * get/set_property_capability set the capability of the property for each | ||
| 230 | * external connector. They are used to set the capability of the property | ||
| 231 | * of each external connector based on the id and property. | ||
| 232 | */ | ||
| 233 | extern int extcon_get_property_capability(struct extcon_dev *edev, | 224 | extern int extcon_get_property_capability(struct extcon_dev *edev, |
| 234 | unsigned int id, unsigned int prop); | 225 | unsigned int id, unsigned int prop); |
| 235 | extern int extcon_set_property_capability(struct extcon_dev *edev, | 226 | extern int extcon_set_property_capability(struct extcon_dev *edev, |
| 236 | unsigned int id, unsigned int prop); | 227 | unsigned int id, unsigned int prop); |
| 237 | 228 | ||
| 238 | /* | 229 | /* |
| 239 | * Following APIs are to monitor the status change of the external connectors. | 230 | * Following APIs register the notifier block in order to detect |
| 231 | * the change of both state and property value for each external connector. | ||
| 232 | * | ||
| 240 | * extcon_register_notifier(*edev, id, *nb) : Register a notifier block | 233 | * extcon_register_notifier(*edev, id, *nb) : Register a notifier block |
| 241 | * for specific external connector of the extcon. | 234 | * for specific external connector of the extcon. |
| 242 | * extcon_register_notifier_all(*edev, *nb) : Register a notifier block | 235 | * extcon_register_notifier_all(*edev, *nb) : Register a notifier block |
| 243 | * for all supported external connectors of the extcon. | 236 | * for all supported external connectors of the extcon. |
| 244 | */ | 237 | */ |
| 245 | extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id, | 238 | extern int extcon_register_notifier(struct extcon_dev *edev, unsigned int id, |
| 246 | struct notifier_block *nb); | 239 | struct notifier_block *nb); |
| 247 | extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id, | 240 | extern int extcon_unregister_notifier(struct extcon_dev *edev, unsigned int id, |
| 248 | struct notifier_block *nb); | 241 | struct notifier_block *nb); |
| 249 | extern int devm_extcon_register_notifier(struct device *dev, | 242 | extern int devm_extcon_register_notifier(struct device *dev, |
| 250 | struct extcon_dev *edev, unsigned int id, | 243 | struct extcon_dev *edev, unsigned int id, |
| 251 | struct notifier_block *nb); | 244 | struct notifier_block *nb); |
| @@ -265,16 +258,15 @@ extern void devm_extcon_unregister_notifier_all(struct device *dev, | |||
| 265 | struct notifier_block *nb); | 258 | struct notifier_block *nb); |
| 266 | 259 | ||
| 267 | /* | 260 | /* |
| 268 | * Following API get the extcon device from devicetree. | 261 | * Following APIs get the extcon_dev from devicetree or by through extcon name. |
| 269 | * This function use phandle of devicetree to get extcon device directly. | ||
| 270 | */ | 262 | */ |
| 263 | extern struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name); | ||
| 271 | extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, | 264 | extern struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, |
| 272 | int index); | 265 | int index); |
| 273 | 266 | ||
| 274 | /* Following API to get information of extcon device */ | 267 | /* Following API get the name of extcon device. */ |
| 275 | extern const char *extcon_get_edev_name(struct extcon_dev *edev); | 268 | extern const char *extcon_get_edev_name(struct extcon_dev *edev); |
| 276 | 269 | ||
| 277 | |||
| 278 | #else /* CONFIG_EXTCON */ | 270 | #else /* CONFIG_EXTCON */ |
| 279 | static inline int extcon_dev_register(struct extcon_dev *edev) | 271 | static inline int extcon_dev_register(struct extcon_dev *edev) |
| 280 | { | 272 | { |
| @@ -284,13 +276,13 @@ static inline int extcon_dev_register(struct extcon_dev *edev) | |||
| 284 | static inline void extcon_dev_unregister(struct extcon_dev *edev) { } | 276 | static inline void extcon_dev_unregister(struct extcon_dev *edev) { } |
| 285 | 277 | ||
| 286 | static inline int devm_extcon_dev_register(struct device *dev, | 278 | static inline int devm_extcon_dev_register(struct device *dev, |
| 287 | struct extcon_dev *edev) | 279 | struct extcon_dev *edev) |
| 288 | { | 280 | { |
| 289 | return -EINVAL; | 281 | return -EINVAL; |
| 290 | } | 282 | } |
| 291 | 283 | ||
| 292 | static inline void devm_extcon_dev_unregister(struct device *dev, | 284 | static inline void devm_extcon_dev_unregister(struct device *dev, |
| 293 | struct extcon_dev *edev) { } | 285 | struct extcon_dev *edev) { } |
| 294 | 286 | ||
| 295 | static inline struct extcon_dev *extcon_dev_allocate(const unsigned int *cable) | 287 | static inline struct extcon_dev *extcon_dev_allocate(const unsigned int *cable) |
| 296 | { | 288 | { |
| @@ -300,7 +292,7 @@ static inline struct extcon_dev *extcon_dev_allocate(const unsigned int *cable) | |||
| 300 | static inline void extcon_dev_free(struct extcon_dev *edev) { } | 292 | static inline void extcon_dev_free(struct extcon_dev *edev) { } |
| 301 | 293 | ||
| 302 | static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, | 294 | static inline struct extcon_dev *devm_extcon_dev_allocate(struct device *dev, |
| 303 | const unsigned int *cable) | 295 | const unsigned int *cable) |
| 304 | { | 296 | { |
| 305 | return ERR_PTR(-ENOSYS); | 297 | return ERR_PTR(-ENOSYS); |
| 306 | } | 298 | } |
| @@ -314,13 +306,13 @@ static inline int extcon_get_state(struct extcon_dev *edev, unsigned int id) | |||
| 314 | } | 306 | } |
| 315 | 307 | ||
| 316 | static inline int extcon_set_state(struct extcon_dev *edev, unsigned int id, | 308 | static inline int extcon_set_state(struct extcon_dev *edev, unsigned int id, |
| 317 | bool cable_state) | 309 | bool state) |
| 318 | { | 310 | { |
| 319 | return 0; | 311 | return 0; |
| 320 | } | 312 | } |
| 321 | 313 | ||
| 322 | static inline int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, | 314 | static inline int extcon_set_state_sync(struct extcon_dev *edev, unsigned int id, |
| 323 | bool cable_state) | 315 | bool state) |
| 324 | { | 316 | { |
| 325 | return 0; | 317 | return 0; |
| 326 | } | 318 | } |
| @@ -331,52 +323,45 @@ static inline int extcon_sync(struct extcon_dev *edev, unsigned int id) | |||
| 331 | } | 323 | } |
| 332 | 324 | ||
| 333 | static inline int extcon_get_property(struct extcon_dev *edev, unsigned int id, | 325 | static inline int extcon_get_property(struct extcon_dev *edev, unsigned int id, |
| 334 | unsigned int prop, | 326 | unsigned int prop, |
| 335 | union extcon_property_value *prop_val) | 327 | union extcon_property_value *prop_val) |
| 336 | { | 328 | { |
| 337 | return 0; | 329 | return 0; |
| 338 | } | 330 | } |
| 339 | static inline int extcon_set_property(struct extcon_dev *edev, unsigned int id, | 331 | static inline int extcon_set_property(struct extcon_dev *edev, unsigned int id, |
| 340 | unsigned int prop, | 332 | unsigned int prop, |
| 341 | union extcon_property_value prop_val) | 333 | union extcon_property_value prop_val) |
| 342 | { | 334 | { |
| 343 | return 0; | 335 | return 0; |
| 344 | } | 336 | } |
| 345 | 337 | ||
| 346 | static inline int extcon_set_property_sync(struct extcon_dev *edev, | 338 | static inline int extcon_set_property_sync(struct extcon_dev *edev, |
| 347 | unsigned int id, unsigned int prop, | 339 | unsigned int id, unsigned int prop, |
| 348 | union extcon_property_value prop_val) | 340 | union extcon_property_value prop_val) |
| 349 | { | 341 | { |
| 350 | return 0; | 342 | return 0; |
| 351 | } | 343 | } |
| 352 | 344 | ||
| 353 | static inline int extcon_get_property_capability(struct extcon_dev *edev, | 345 | static inline int extcon_get_property_capability(struct extcon_dev *edev, |
| 354 | unsigned int id, unsigned int prop) | 346 | unsigned int id, unsigned int prop) |
| 355 | { | 347 | { |
| 356 | return 0; | 348 | return 0; |
| 357 | } | 349 | } |
| 358 | 350 | ||
| 359 | static inline int extcon_set_property_capability(struct extcon_dev *edev, | 351 | static inline int extcon_set_property_capability(struct extcon_dev *edev, |
| 360 | unsigned int id, unsigned int prop) | 352 | unsigned int id, unsigned int prop) |
| 361 | { | 353 | { |
| 362 | return 0; | 354 | return 0; |
| 363 | } | 355 | } |
| 364 | 356 | ||
| 365 | static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) | ||
| 366 | { | ||
| 367 | return NULL; | ||
| 368 | } | ||
| 369 | |||
| 370 | static inline int extcon_register_notifier(struct extcon_dev *edev, | 357 | static inline int extcon_register_notifier(struct extcon_dev *edev, |
| 371 | unsigned int id, | 358 | unsigned int id, struct notifier_block *nb) |
| 372 | struct notifier_block *nb) | ||
| 373 | { | 359 | { |
| 374 | return 0; | 360 | return 0; |
| 375 | } | 361 | } |
| 376 | 362 | ||
| 377 | static inline int extcon_unregister_notifier(struct extcon_dev *edev, | 363 | static inline int extcon_unregister_notifier(struct extcon_dev *edev, |
| 378 | unsigned int id, | 364 | unsigned int id, struct notifier_block *nb) |
| 379 | struct notifier_block *nb) | ||
| 380 | { | 365 | { |
| 381 | return 0; | 366 | return 0; |
| 382 | } | 367 | } |
| @@ -392,8 +377,13 @@ static inline void devm_extcon_unregister_notifier(struct device *dev, | |||
| 392 | struct extcon_dev *edev, unsigned int id, | 377 | struct extcon_dev *edev, unsigned int id, |
| 393 | struct notifier_block *nb) { } | 378 | struct notifier_block *nb) { } |
| 394 | 379 | ||
| 380 | static inline struct extcon_dev *extcon_get_extcon_dev(const char *extcon_name) | ||
| 381 | { | ||
| 382 | return ERR_PTR(-ENODEV); | ||
| 383 | } | ||
| 384 | |||
| 395 | static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, | 385 | static inline struct extcon_dev *extcon_get_edev_by_phandle(struct device *dev, |
| 396 | int index) | 386 | int index) |
| 397 | { | 387 | { |
| 398 | return ERR_PTR(-ENODEV); | 388 | return ERR_PTR(-ENODEV); |
| 399 | } | 389 | } |
| @@ -411,26 +401,14 @@ struct extcon_specific_cable_nb { | |||
| 411 | }; | 401 | }; |
| 412 | 402 | ||
| 413 | static inline int extcon_register_interest(struct extcon_specific_cable_nb *obj, | 403 | static inline int extcon_register_interest(struct extcon_specific_cable_nb *obj, |
| 414 | const char *extcon_name, const char *cable_name, | 404 | const char *extcon_name, const char *cable_name, |
| 415 | struct notifier_block *nb) | 405 | struct notifier_block *nb) |
| 416 | { | 406 | { |
| 417 | return -EINVAL; | 407 | return -EINVAL; |
| 418 | } | 408 | } |
| 419 | 409 | ||
| 420 | static inline int extcon_unregister_interest(struct extcon_specific_cable_nb | 410 | static inline int extcon_unregister_interest(struct extcon_specific_cable_nb *obj) |
| 421 | *obj) | ||
| 422 | { | 411 | { |
| 423 | return -EINVAL; | 412 | return -EINVAL; |
| 424 | } | 413 | } |
| 425 | |||
| 426 | static inline int extcon_get_cable_state_(struct extcon_dev *edev, unsigned int id) | ||
| 427 | { | ||
| 428 | return extcon_get_state(edev, id); | ||
| 429 | } | ||
| 430 | |||
| 431 | static inline int extcon_set_cable_state_(struct extcon_dev *edev, unsigned int id, | ||
| 432 | bool cable_state) | ||
| 433 | { | ||
| 434 | return extcon_set_state_sync(edev, id, cable_state); | ||
| 435 | } | ||
| 436 | #endif /* __LINUX_EXTCON_H__ */ | 414 | #endif /* __LINUX_EXTCON_H__ */ |
diff --git a/include/linux/fmc.h b/include/linux/fmc.h index a5f0aa5c2a8d..3dc8a1b2db7b 100644 --- a/include/linux/fmc.h +++ b/include/linux/fmc.h | |||
| @@ -132,6 +132,8 @@ struct fmc_operations { | |||
| 132 | uint32_t (*read32)(struct fmc_device *fmc, int offset); | 132 | uint32_t (*read32)(struct fmc_device *fmc, int offset); |
| 133 | void (*write32)(struct fmc_device *fmc, uint32_t value, int offset); | 133 | void (*write32)(struct fmc_device *fmc, uint32_t value, int offset); |
| 134 | int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv); | 134 | int (*validate)(struct fmc_device *fmc, struct fmc_driver *drv); |
| 135 | int (*reprogram_raw)(struct fmc_device *f, struct fmc_driver *d, | ||
| 136 | void *gw, unsigned long len); | ||
| 135 | int (*reprogram)(struct fmc_device *f, struct fmc_driver *d, char *gw); | 137 | int (*reprogram)(struct fmc_device *f, struct fmc_driver *d, char *gw); |
| 136 | int (*irq_request)(struct fmc_device *fmc, irq_handler_t h, | 138 | int (*irq_request)(struct fmc_device *fmc, irq_handler_t h, |
| 137 | char *name, int flags); | 139 | char *name, int flags); |
| @@ -144,6 +146,8 @@ struct fmc_operations { | |||
| 144 | }; | 146 | }; |
| 145 | 147 | ||
| 146 | /* Prefer this helper rather than calling of fmc->reprogram directly */ | 148 | /* Prefer this helper rather than calling of fmc->reprogram directly */ |
| 149 | int fmc_reprogram_raw(struct fmc_device *fmc, struct fmc_driver *d, | ||
| 150 | void *gw, unsigned long len, int sdb_entry); | ||
| 147 | extern int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw, | 151 | extern int fmc_reprogram(struct fmc_device *f, struct fmc_driver *d, char *gw, |
| 148 | int sdb_entry); | 152 | int sdb_entry); |
| 149 | 153 | ||
| @@ -180,6 +184,9 @@ struct fmc_device { | |||
| 180 | uint32_t device_id; /* Filled by the device */ | 184 | uint32_t device_id; /* Filled by the device */ |
| 181 | char *mezzanine_name; /* Defaults to ``fmc'' */ | 185 | char *mezzanine_name; /* Defaults to ``fmc'' */ |
| 182 | void *mezzanine_data; | 186 | void *mezzanine_data; |
| 187 | |||
| 188 | struct dentry *dbg_dir; | ||
| 189 | struct dentry *dbg_sdb_dump; | ||
| 183 | }; | 190 | }; |
| 184 | #define to_fmc_device(x) container_of((x), struct fmc_device, dev) | 191 | #define to_fmc_device(x) container_of((x), struct fmc_device, dev) |
| 185 | 192 | ||
| @@ -217,14 +224,23 @@ static inline void fmc_set_drvdata(struct fmc_device *fmc, void *data) | |||
| 217 | dev_set_drvdata(&fmc->dev, data); | 224 | dev_set_drvdata(&fmc->dev, data); |
| 218 | } | 225 | } |
| 219 | 226 | ||
| 220 | /* The 4 access points */ | 227 | struct fmc_gateware { |
| 228 | void *bitstream; | ||
| 229 | unsigned long len; | ||
| 230 | }; | ||
| 231 | |||
| 232 | /* The 5 access points */ | ||
| 221 | extern int fmc_driver_register(struct fmc_driver *drv); | 233 | extern int fmc_driver_register(struct fmc_driver *drv); |
| 222 | extern void fmc_driver_unregister(struct fmc_driver *drv); | 234 | extern void fmc_driver_unregister(struct fmc_driver *drv); |
| 223 | extern int fmc_device_register(struct fmc_device *tdev); | 235 | extern int fmc_device_register(struct fmc_device *tdev); |
| 236 | extern int fmc_device_register_gw(struct fmc_device *tdev, | ||
| 237 | struct fmc_gateware *gw); | ||
| 224 | extern void fmc_device_unregister(struct fmc_device *tdev); | 238 | extern void fmc_device_unregister(struct fmc_device *tdev); |
| 225 | 239 | ||
| 226 | /* Two more for device sets, all driven by the same FPGA */ | 240 | /* Three more for device sets, all driven by the same FPGA */ |
| 227 | extern int fmc_device_register_n(struct fmc_device **devs, int n); | 241 | extern int fmc_device_register_n(struct fmc_device **devs, int n); |
| 242 | extern int fmc_device_register_n_gw(struct fmc_device **devs, int n, | ||
| 243 | struct fmc_gateware *gw); | ||
| 228 | extern void fmc_device_unregister_n(struct fmc_device **devs, int n); | 244 | extern void fmc_device_unregister_n(struct fmc_device **devs, int n); |
| 229 | 245 | ||
| 230 | /* Internal cross-calls between files; not exported to other modules */ | 246 | /* Internal cross-calls between files; not exported to other modules */ |
| @@ -232,6 +248,23 @@ extern int fmc_match(struct device *dev, struct device_driver *drv); | |||
| 232 | extern int fmc_fill_id_info(struct fmc_device *fmc); | 248 | extern int fmc_fill_id_info(struct fmc_device *fmc); |
| 233 | extern void fmc_free_id_info(struct fmc_device *fmc); | 249 | extern void fmc_free_id_info(struct fmc_device *fmc); |
| 234 | extern void fmc_dump_eeprom(const struct fmc_device *fmc); | 250 | extern void fmc_dump_eeprom(const struct fmc_device *fmc); |
| 235 | extern void fmc_dump_sdb(const struct fmc_device *fmc); | 251 | |
| 252 | /* helpers for FMC operations */ | ||
| 253 | extern int fmc_irq_request(struct fmc_device *fmc, irq_handler_t h, | ||
| 254 | char *name, int flags); | ||
| 255 | extern void fmc_irq_free(struct fmc_device *fmc); | ||
| 256 | extern void fmc_irq_ack(struct fmc_device *fmc); | ||
| 257 | extern int fmc_validate(struct fmc_device *fmc, struct fmc_driver *drv); | ||
| 258 | extern int fmc_gpio_config(struct fmc_device *fmc, struct fmc_gpio *gpio, | ||
| 259 | int ngpio); | ||
| 260 | extern int fmc_read_ee(struct fmc_device *fmc, int pos, void *d, int l); | ||
| 261 | extern int fmc_write_ee(struct fmc_device *fmc, int pos, const void *d, int l); | ||
| 262 | |||
| 263 | /* helpers for FMC operations */ | ||
| 264 | extern int fmc_irq_request(struct fmc_device *fmc, irq_handler_t h, | ||
| 265 | char *name, int flags); | ||
| 266 | extern void fmc_irq_free(struct fmc_device *fmc); | ||
| 267 | extern void fmc_irq_ack(struct fmc_device *fmc); | ||
| 268 | extern int fmc_validate(struct fmc_device *fmc, struct fmc_driver *drv); | ||
| 236 | 269 | ||
| 237 | #endif /* __LINUX_FMC_H__ */ | 270 | #endif /* __LINUX_FMC_H__ */ |
diff --git a/include/linux/fpga/fpga-mgr.h b/include/linux/fpga/fpga-mgr.h index b4ac24c4411d..bfa14bc023fb 100644 --- a/include/linux/fpga/fpga-mgr.h +++ b/include/linux/fpga/fpga-mgr.h | |||
| @@ -67,10 +67,14 @@ enum fpga_mgr_states { | |||
| 67 | * FPGA Manager flags | 67 | * FPGA Manager flags |
| 68 | * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported | 68 | * FPGA_MGR_PARTIAL_RECONFIG: do partial reconfiguration if supported |
| 69 | * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting | 69 | * FPGA_MGR_EXTERNAL_CONFIG: FPGA has been configured prior to Linux booting |
| 70 | * FPGA_MGR_BITSTREAM_LSB_FIRST: SPI bitstream bit order is LSB first | ||
| 71 | * FPGA_MGR_COMPRESSED_BITSTREAM: FPGA bitstream is compressed | ||
| 70 | */ | 72 | */ |
| 71 | #define FPGA_MGR_PARTIAL_RECONFIG BIT(0) | 73 | #define FPGA_MGR_PARTIAL_RECONFIG BIT(0) |
| 72 | #define FPGA_MGR_EXTERNAL_CONFIG BIT(1) | 74 | #define FPGA_MGR_EXTERNAL_CONFIG BIT(1) |
| 73 | #define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) | 75 | #define FPGA_MGR_ENCRYPTED_BITSTREAM BIT(2) |
| 76 | #define FPGA_MGR_BITSTREAM_LSB_FIRST BIT(3) | ||
| 77 | #define FPGA_MGR_COMPRESSED_BITSTREAM BIT(4) | ||
| 74 | 78 | ||
| 75 | /** | 79 | /** |
| 76 | * struct fpga_image_info - information specific to a FPGA image | 80 | * struct fpga_image_info - information specific to a FPGA image |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2625fc47c7e5..cc2e0f5a8fd1 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2473,9 +2473,13 @@ static inline void bd_unlink_disk_holder(struct block_device *bdev, | |||
| 2473 | #endif | 2473 | #endif |
| 2474 | 2474 | ||
| 2475 | /* fs/char_dev.c */ | 2475 | /* fs/char_dev.c */ |
| 2476 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 2476 | #define CHRDEV_MAJOR_MAX 512 |
| 2477 | /* Marks the bottom of the first segment of free char majors */ | 2477 | /* Marks the bottom of the first segment of free char majors */ |
| 2478 | #define CHRDEV_MAJOR_DYN_END 234 | 2478 | #define CHRDEV_MAJOR_DYN_END 234 |
| 2479 | /* Marks the top and bottom of the second segment of free char majors */ | ||
| 2480 | #define CHRDEV_MAJOR_DYN_EXT_START 511 | ||
| 2481 | #define CHRDEV_MAJOR_DYN_EXT_END 384 | ||
| 2482 | |||
| 2479 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); | 2483 | extern int alloc_chrdev_region(dev_t *, unsigned, unsigned, const char *); |
| 2480 | extern int register_chrdev_region(dev_t, unsigned, const char *); | 2484 | extern int register_chrdev_region(dev_t, unsigned, const char *); |
| 2481 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, | 2485 | extern int __register_chrdev(unsigned int major, unsigned int baseminor, |
| @@ -2502,14 +2506,14 @@ static inline void unregister_chrdev(unsigned int major, const char *name) | |||
| 2502 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | 2506 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ |
| 2503 | 2507 | ||
| 2504 | #ifdef CONFIG_BLOCK | 2508 | #ifdef CONFIG_BLOCK |
| 2505 | #define BLKDEV_MAJOR_HASH_SIZE 255 | 2509 | #define BLKDEV_MAJOR_MAX 512 |
| 2506 | extern const char *__bdevname(dev_t, char *buffer); | 2510 | extern const char *__bdevname(dev_t, char *buffer); |
| 2507 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 2511 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
| 2508 | extern struct block_device *lookup_bdev(const char *); | 2512 | extern struct block_device *lookup_bdev(const char *); |
| 2509 | extern void blkdev_show(struct seq_file *,off_t); | 2513 | extern void blkdev_show(struct seq_file *,off_t); |
| 2510 | 2514 | ||
| 2511 | #else | 2515 | #else |
| 2512 | #define BLKDEV_MAJOR_HASH_SIZE 0 | 2516 | #define BLKDEV_MAJOR_MAX 0 |
| 2513 | #endif | 2517 | #endif |
| 2514 | 2518 | ||
| 2515 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 2519 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h index b7d7bbec74e0..07650d0232cc 100644 --- a/include/linux/hyperv.h +++ b/include/linux/hyperv.h | |||
| @@ -124,10 +124,7 @@ struct hv_ring_buffer_info { | |||
| 124 | spinlock_t ring_lock; | 124 | spinlock_t ring_lock; |
| 125 | 125 | ||
| 126 | u32 ring_datasize; /* < ring_size */ | 126 | u32 ring_datasize; /* < ring_size */ |
| 127 | u32 ring_data_startoffset; | ||
| 128 | u32 priv_write_index; | ||
| 129 | u32 priv_read_index; | 127 | u32 priv_read_index; |
| 130 | u32 cached_read_index; | ||
| 131 | }; | 128 | }; |
| 132 | 129 | ||
| 133 | /* | 130 | /* |
| @@ -180,19 +177,6 @@ static inline u32 hv_get_bytes_to_write(const struct hv_ring_buffer_info *rbi) | |||
| 180 | return write; | 177 | return write; |
| 181 | } | 178 | } |
| 182 | 179 | ||
| 183 | static inline u32 hv_get_cached_bytes_to_write( | ||
| 184 | const struct hv_ring_buffer_info *rbi) | ||
| 185 | { | ||
| 186 | u32 read_loc, write_loc, dsize, write; | ||
| 187 | |||
| 188 | dsize = rbi->ring_datasize; | ||
| 189 | read_loc = rbi->cached_read_index; | ||
| 190 | write_loc = rbi->ring_buffer->write_index; | ||
| 191 | |||
| 192 | write = write_loc >= read_loc ? dsize - (write_loc - read_loc) : | ||
| 193 | read_loc - write_loc; | ||
| 194 | return write; | ||
| 195 | } | ||
| 196 | /* | 180 | /* |
| 197 | * VMBUS version is 32 bit entity broken up into | 181 | * VMBUS version is 32 bit entity broken up into |
| 198 | * two 16 bit quantities: major_number. minor_number. | 182 | * two 16 bit quantities: major_number. minor_number. |
| @@ -895,6 +879,8 @@ struct vmbus_channel { | |||
| 895 | */ | 879 | */ |
| 896 | enum hv_numa_policy affinity_policy; | 880 | enum hv_numa_policy affinity_policy; |
| 897 | 881 | ||
| 882 | bool probe_done; | ||
| 883 | |||
| 898 | }; | 884 | }; |
| 899 | 885 | ||
| 900 | static inline bool is_hvsock_channel(const struct vmbus_channel *c) | 886 | static inline bool is_hvsock_channel(const struct vmbus_channel *c) |
| @@ -1474,55 +1460,6 @@ hv_get_ring_buffer(const struct hv_ring_buffer_info *ring_info) | |||
| 1474 | } | 1460 | } |
| 1475 | 1461 | ||
| 1476 | /* | 1462 | /* |
| 1477 | * To optimize the flow management on the send-side, | ||
| 1478 | * when the sender is blocked because of lack of | ||
| 1479 | * sufficient space in the ring buffer, potential the | ||
| 1480 | * consumer of the ring buffer can signal the producer. | ||
| 1481 | * This is controlled by the following parameters: | ||
| 1482 | * | ||
| 1483 | * 1. pending_send_sz: This is the size in bytes that the | ||
| 1484 | * producer is trying to send. | ||
| 1485 | * 2. The feature bit feat_pending_send_sz set to indicate if | ||
| 1486 | * the consumer of the ring will signal when the ring | ||
| 1487 | * state transitions from being full to a state where | ||
| 1488 | * there is room for the producer to send the pending packet. | ||
| 1489 | */ | ||
| 1490 | |||
| 1491 | static inline void hv_signal_on_read(struct vmbus_channel *channel) | ||
| 1492 | { | ||
| 1493 | u32 cur_write_sz, cached_write_sz; | ||
| 1494 | u32 pending_sz; | ||
| 1495 | struct hv_ring_buffer_info *rbi = &channel->inbound; | ||
| 1496 | |||
| 1497 | /* | ||
| 1498 | * Issue a full memory barrier before making the signaling decision. | ||
| 1499 | * Here is the reason for having this barrier: | ||
| 1500 | * If the reading of the pend_sz (in this function) | ||
| 1501 | * were to be reordered and read before we commit the new read | ||
| 1502 | * index (in the calling function) we could | ||
| 1503 | * have a problem. If the host were to set the pending_sz after we | ||
| 1504 | * have sampled pending_sz and go to sleep before we commit the | ||
| 1505 | * read index, we could miss sending the interrupt. Issue a full | ||
| 1506 | * memory barrier to address this. | ||
| 1507 | */ | ||
| 1508 | virt_mb(); | ||
| 1509 | |||
| 1510 | pending_sz = READ_ONCE(rbi->ring_buffer->pending_send_sz); | ||
| 1511 | /* If the other end is not blocked on write don't bother. */ | ||
| 1512 | if (pending_sz == 0) | ||
| 1513 | return; | ||
| 1514 | |||
| 1515 | cur_write_sz = hv_get_bytes_to_write(rbi); | ||
| 1516 | |||
| 1517 | if (cur_write_sz < pending_sz) | ||
| 1518 | return; | ||
| 1519 | |||
| 1520 | cached_write_sz = hv_get_cached_bytes_to_write(rbi); | ||
| 1521 | if (cached_write_sz < pending_sz) | ||
| 1522 | vmbus_setevent(channel); | ||
| 1523 | } | ||
| 1524 | |||
| 1525 | /* | ||
| 1526 | * Mask off host interrupt callback notifications | 1463 | * Mask off host interrupt callback notifications |
| 1527 | */ | 1464 | */ |
| 1528 | static inline void hv_begin_read(struct hv_ring_buffer_info *rbi) | 1465 | static inline void hv_begin_read(struct hv_ring_buffer_info *rbi) |
diff --git a/include/linux/mfd/cros_ec_commands.h b/include/linux/mfd/cros_ec_commands.h index 190c8f4afa02..2b16e95b9bb8 100644 --- a/include/linux/mfd/cros_ec_commands.h +++ b/include/linux/mfd/cros_ec_commands.h | |||
| @@ -285,6 +285,11 @@ enum host_event_code { | |||
| 285 | EC_HOST_EVENT_HANG_DETECT = 20, | 285 | EC_HOST_EVENT_HANG_DETECT = 20, |
| 286 | /* Hang detect logic detected a hang and warm rebooted the AP */ | 286 | /* Hang detect logic detected a hang and warm rebooted the AP */ |
| 287 | EC_HOST_EVENT_HANG_REBOOT = 21, | 287 | EC_HOST_EVENT_HANG_REBOOT = 21, |
| 288 | /* PD MCU triggering host event */ | ||
| 289 | EC_HOST_EVENT_PD_MCU = 22, | ||
| 290 | |||
| 291 | /* EC desires to change state of host-controlled USB mux */ | ||
| 292 | EC_HOST_EVENT_USB_MUX = 28, | ||
| 288 | 293 | ||
| 289 | /* | 294 | /* |
| 290 | * The high bit of the event mask is not used as a host event code. If | 295 | * The high bit of the event mask is not used as a host event code. If |
| @@ -2905,6 +2910,76 @@ struct ec_params_usb_pd_control { | |||
| 2905 | uint8_t mux; | 2910 | uint8_t mux; |
| 2906 | } __packed; | 2911 | } __packed; |
| 2907 | 2912 | ||
| 2913 | #define PD_CTRL_RESP_ENABLED_COMMS (1 << 0) /* Communication enabled */ | ||
| 2914 | #define PD_CTRL_RESP_ENABLED_CONNECTED (1 << 1) /* Device connected */ | ||
| 2915 | #define PD_CTRL_RESP_ENABLED_PD_CAPABLE (1 << 2) /* Partner is PD capable */ | ||
| 2916 | |||
| 2917 | struct ec_response_usb_pd_control_v1 { | ||
| 2918 | uint8_t enabled; | ||
| 2919 | uint8_t role; | ||
| 2920 | uint8_t polarity; | ||
| 2921 | char state[32]; | ||
| 2922 | } __packed; | ||
| 2923 | |||
| 2924 | #define EC_CMD_USB_PD_PORTS 0x102 | ||
| 2925 | |||
| 2926 | struct ec_response_usb_pd_ports { | ||
| 2927 | uint8_t num_ports; | ||
| 2928 | } __packed; | ||
| 2929 | |||
| 2930 | #define EC_CMD_USB_PD_POWER_INFO 0x103 | ||
| 2931 | |||
| 2932 | #define PD_POWER_CHARGING_PORT 0xff | ||
| 2933 | struct ec_params_usb_pd_power_info { | ||
| 2934 | uint8_t port; | ||
| 2935 | } __packed; | ||
| 2936 | |||
| 2937 | enum usb_chg_type { | ||
| 2938 | USB_CHG_TYPE_NONE, | ||
| 2939 | USB_CHG_TYPE_PD, | ||
| 2940 | USB_CHG_TYPE_C, | ||
| 2941 | USB_CHG_TYPE_PROPRIETARY, | ||
| 2942 | USB_CHG_TYPE_BC12_DCP, | ||
| 2943 | USB_CHG_TYPE_BC12_CDP, | ||
| 2944 | USB_CHG_TYPE_BC12_SDP, | ||
| 2945 | USB_CHG_TYPE_OTHER, | ||
| 2946 | USB_CHG_TYPE_VBUS, | ||
| 2947 | USB_CHG_TYPE_UNKNOWN, | ||
| 2948 | }; | ||
| 2949 | |||
| 2950 | struct usb_chg_measures { | ||
| 2951 | uint16_t voltage_max; | ||
| 2952 | uint16_t voltage_now; | ||
| 2953 | uint16_t current_max; | ||
| 2954 | uint16_t current_lim; | ||
| 2955 | } __packed; | ||
| 2956 | |||
| 2957 | struct ec_response_usb_pd_power_info { | ||
| 2958 | uint8_t role; | ||
| 2959 | uint8_t type; | ||
| 2960 | uint8_t dualrole; | ||
| 2961 | uint8_t reserved1; | ||
| 2962 | struct usb_chg_measures meas; | ||
| 2963 | uint32_t max_power; | ||
| 2964 | } __packed; | ||
| 2965 | |||
| 2966 | /* Get info about USB-C SS muxes */ | ||
| 2967 | #define EC_CMD_USB_PD_MUX_INFO 0x11a | ||
| 2968 | |||
| 2969 | struct ec_params_usb_pd_mux_info { | ||
| 2970 | uint8_t port; /* USB-C port number */ | ||
| 2971 | } __packed; | ||
| 2972 | |||
| 2973 | /* Flags representing mux state */ | ||
| 2974 | #define USB_PD_MUX_USB_ENABLED (1 << 0) | ||
| 2975 | #define USB_PD_MUX_DP_ENABLED (1 << 1) | ||
| 2976 | #define USB_PD_MUX_POLARITY_INVERTED (1 << 2) | ||
| 2977 | #define USB_PD_MUX_HPD_IRQ (1 << 3) | ||
| 2978 | |||
| 2979 | struct ec_response_usb_pd_mux_info { | ||
| 2980 | uint8_t flags; /* USB_PD_MUX_*-encoded USB mux state */ | ||
| 2981 | } __packed; | ||
| 2982 | |||
| 2908 | /*****************************************************************************/ | 2983 | /*****************************************************************************/ |
| 2909 | /* | 2984 | /* |
| 2910 | * Passthru commands | 2985 | * Passthru commands |
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h index 38a372a0e285..2227c6a75d84 100644 --- a/include/linux/mfd/ds1wm.h +++ b/include/linux/mfd/ds1wm.h | |||
| @@ -1,13 +1,28 @@ | |||
| 1 | /* MFD cell driver data for the DS1WM driver */ | 1 | /* MFD cell driver data for the DS1WM driver |
| 2 | * | ||
| 3 | * to be defined in the MFD device that is | ||
| 4 | * using this driver for one of his sub devices | ||
| 5 | */ | ||
| 2 | 6 | ||
| 3 | struct ds1wm_driver_data { | 7 | struct ds1wm_driver_data { |
| 4 | int active_high; | 8 | int active_high; |
| 5 | int clock_rate; | 9 | int clock_rate; |
| 6 | /* in milliseconds, the amount of time to */ | 10 | /* in milliseconds, the amount of time to |
| 7 | /* sleep following a reset pulse. Zero */ | 11 | * sleep following a reset pulse. Zero |
| 8 | /* should work if your bus devices recover*/ | 12 | * should work if your bus devices recover |
| 9 | /* time respects the 1-wire spec since the*/ | 13 | * time respects the 1-wire spec since the |
| 10 | /* ds1wm implements the precise timings of*/ | 14 | * ds1wm implements the precise timings of |
| 11 | /* a reset pulse/presence detect sequence.*/ | 15 | * a reset pulse/presence detect sequence. |
| 16 | */ | ||
| 12 | unsigned int reset_recover_delay; | 17 | unsigned int reset_recover_delay; |
| 18 | |||
| 19 | /* Say 1 here for big endian Hardware | ||
| 20 | * (only relevant with bus-shift > 0 | ||
| 21 | */ | ||
| 22 | bool is_hw_big_endian; | ||
| 23 | |||
| 24 | /* left shift of register number to get register address offsett. | ||
| 25 | * Only 0,1,2 allowed for 8,16 or 32 bit bus width respectively | ||
| 26 | */ | ||
| 27 | unsigned int bus_shift; | ||
| 13 | }; | 28 | }; |
diff --git a/include/linux/mux/consumer.h b/include/linux/mux/consumer.h index 5577e1b773c4..ea96d4c82be7 100644 --- a/include/linux/mux/consumer.h +++ b/include/linux/mux/consumer.h | |||
| @@ -13,6 +13,8 @@ | |||
| 13 | #ifndef _LINUX_MUX_CONSUMER_H | 13 | #ifndef _LINUX_MUX_CONSUMER_H |
| 14 | #define _LINUX_MUX_CONSUMER_H | 14 | #define _LINUX_MUX_CONSUMER_H |
| 15 | 15 | ||
| 16 | #include <linux/compiler.h> | ||
| 17 | |||
| 16 | struct device; | 18 | struct device; |
| 17 | struct mux_control; | 19 | struct mux_control; |
| 18 | 20 | ||
diff --git a/include/linux/nvmem-consumer.h b/include/linux/nvmem-consumer.h index c2256d746543..4e85447f7860 100644 --- a/include/linux/nvmem-consumer.h +++ b/include/linux/nvmem-consumer.h | |||
| @@ -12,6 +12,9 @@ | |||
| 12 | #ifndef _LINUX_NVMEM_CONSUMER_H | 12 | #ifndef _LINUX_NVMEM_CONSUMER_H |
| 13 | #define _LINUX_NVMEM_CONSUMER_H | 13 | #define _LINUX_NVMEM_CONSUMER_H |
| 14 | 14 | ||
| 15 | #include <linux/err.h> | ||
| 16 | #include <linux/errno.h> | ||
| 17 | |||
| 15 | struct device; | 18 | struct device; |
| 16 | struct device_node; | 19 | struct device_node; |
| 17 | /* consumer cookie */ | 20 | /* consumer cookie */ |
| @@ -35,6 +38,7 @@ void nvmem_cell_put(struct nvmem_cell *cell); | |||
| 35 | void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); | 38 | void devm_nvmem_cell_put(struct device *dev, struct nvmem_cell *cell); |
| 36 | void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len); | 39 | void *nvmem_cell_read(struct nvmem_cell *cell, size_t *len); |
| 37 | int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len); | 40 | int nvmem_cell_write(struct nvmem_cell *cell, void *buf, size_t len); |
| 41 | int nvmem_cell_read_u32(struct device *dev, const char *cell_id, u32 *val); | ||
| 38 | 42 | ||
| 39 | /* direct nvmem device read/write interface */ | 43 | /* direct nvmem device read/write interface */ |
| 40 | struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); | 44 | struct nvmem_device *nvmem_device_get(struct device *dev, const char *name); |
| @@ -85,6 +89,12 @@ static inline int nvmem_cell_write(struct nvmem_cell *cell, | |||
| 85 | return -ENOSYS; | 89 | return -ENOSYS; |
| 86 | } | 90 | } |
| 87 | 91 | ||
| 92 | static inline int nvmem_cell_read_u32(struct device *dev, | ||
| 93 | const char *cell_id, u32 *val) | ||
| 94 | { | ||
| 95 | return -ENOSYS; | ||
| 96 | } | ||
| 97 | |||
| 88 | static inline struct nvmem_device *nvmem_device_get(struct device *dev, | 98 | static inline struct nvmem_device *nvmem_device_get(struct device *dev, |
| 89 | const char *name) | 99 | const char *name) |
| 90 | { | 100 | { |
diff --git a/include/linux/w1.h b/include/linux/w1.h index 90cbe7e65059..5b2972946dda 100644 --- a/include/linux/w1.h +++ b/include/linux/w1.h | |||
| @@ -68,6 +68,7 @@ struct w1_reg_num { | |||
| 68 | * @family: module for device family type | 68 | * @family: module for device family type |
| 69 | * @family_data: pointer for use by the family module | 69 | * @family_data: pointer for use by the family module |
| 70 | * @dev: kernel device identifier | 70 | * @dev: kernel device identifier |
| 71 | * @hwmon: pointer to hwmon device | ||
| 71 | * | 72 | * |
| 72 | */ | 73 | */ |
| 73 | struct w1_slave { | 74 | struct w1_slave { |
| @@ -83,6 +84,7 @@ struct w1_slave { | |||
| 83 | struct w1_family *family; | 84 | struct w1_family *family; |
| 84 | void *family_data; | 85 | void *family_data; |
| 85 | struct device dev; | 86 | struct device dev; |
| 87 | struct device *hwmon; | ||
| 86 | }; | 88 | }; |
| 87 | 89 | ||
| 88 | typedef void (*w1_slave_found_callback)(struct w1_master *, u64); | 90 | typedef void (*w1_slave_found_callback)(struct w1_master *, u64); |
| @@ -250,11 +252,13 @@ void w1_remove_master_device(struct w1_bus_master *master); | |||
| 250 | * @add_slave: add_slave | 252 | * @add_slave: add_slave |
| 251 | * @remove_slave: remove_slave | 253 | * @remove_slave: remove_slave |
| 252 | * @groups: sysfs group | 254 | * @groups: sysfs group |
| 255 | * @chip_info: pointer to struct hwmon_chip_info | ||
| 253 | */ | 256 | */ |
| 254 | struct w1_family_ops { | 257 | struct w1_family_ops { |
| 255 | int (*add_slave)(struct w1_slave *sl); | 258 | int (*add_slave)(struct w1_slave *sl); |
| 256 | void (*remove_slave)(struct w1_slave *sl); | 259 | void (*remove_slave)(struct w1_slave *sl); |
| 257 | const struct attribute_group **groups; | 260 | const struct attribute_group **groups; |
| 261 | const struct hwmon_chip_info *chip_info; | ||
| 258 | }; | 262 | }; |
| 259 | 263 | ||
| 260 | /** | 264 | /** |
