Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: intel: Split out some definitions to a common header

We are going to use some definitions in the other Intel extcon drivers,
thus, split out them to a common header file.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>

authored by

Andy Shevchenko and committed by
Chanwoo Choi
098b7ae8 db8b4aef

+27 -14
+7 -14
drivers/extcon/extcon-intel-cht-wc.c
··· 17 17 #include <linux/regmap.h> 18 18 #include <linux/slab.h> 19 19 20 + #include "extcon-intel.h" 21 + 20 22 #define CHT_WC_PHYCTRL 0x5e07 21 23 22 24 #define CHT_WC_CHGRCTRL0 0x5e16 ··· 82 80 #define CHT_WC_VBUS_GPIO_CTLO_DRV_OD BIT(4) 83 81 #define CHT_WC_VBUS_GPIO_CTLO_DIR_OUT BIT(5) 84 82 85 - enum cht_wc_usb_id { 86 - USB_ID_OTG, 87 - USB_ID_GND, 88 - USB_ID_FLOAT, 89 - USB_RID_A, 90 - USB_RID_B, 91 - USB_RID_C, 92 - }; 93 - 94 83 enum cht_wc_mux_select { 95 84 MUX_SEL_PMIC = 0, 96 85 MUX_SEL_SOC, ··· 109 116 { 110 117 switch ((pwrsrc_sts & CHT_WC_PWRSRC_USBID_MASK) >> CHT_WC_PWRSRC_USBID_SHIFT) { 111 118 case CHT_WC_PWRSRC_RID_GND: 112 - return USB_ID_GND; 119 + return INTEL_USB_ID_GND; 113 120 case CHT_WC_PWRSRC_RID_FLOAT: 114 - return USB_ID_FLOAT; 121 + return INTEL_USB_ID_FLOAT; 115 122 case CHT_WC_PWRSRC_RID_ACA: 116 123 default: 117 124 /* ··· 119 126 * the USBID GPADC channel here and determine ACA role 120 127 * based on that. 121 128 */ 122 - return USB_ID_FLOAT; 129 + return INTEL_USB_ID_FLOAT; 123 130 } 124 131 } 125 132 ··· 253 260 } 254 261 255 262 id = cht_wc_extcon_get_id(ext, pwrsrc_sts); 256 - if (id == USB_ID_GND) { 263 + if (id == INTEL_USB_ID_GND) { 257 264 cht_wc_extcon_enable_charging(ext, false); 258 265 cht_wc_extcon_set_otgmode(ext, true); 259 266 ··· 286 293 ext->previous_cable = cable; 287 294 } 288 295 289 - ext->usb_host = ((id == USB_ID_GND) || (id == USB_RID_A)); 296 + ext->usb_host = ((id == INTEL_USB_ID_GND) || (id == INTEL_USB_RID_A)); 290 297 extcon_set_state_sync(ext->edev, EXTCON_USB_HOST, ext->usb_host); 291 298 } 292 299
+20
drivers/extcon/extcon-intel.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * Header file for Intel extcon hardware 4 + * 5 + * Copyright (C) 2019 Intel Corporation. All rights reserved. 6 + */ 7 + 8 + #ifndef __EXTCON_INTEL_H__ 9 + #define __EXTCON_INTEL_H__ 10 + 11 + enum extcon_intel_usb_id { 12 + INTEL_USB_ID_OTG, 13 + INTEL_USB_ID_GND, 14 + INTEL_USB_ID_FLOAT, 15 + INTEL_USB_RID_A, 16 + INTEL_USB_RID_B, 17 + INTEL_USB_RID_C, 18 + }; 19 + 20 + #endif /* __EXTCON_INTEL_H__ */