Re: [PATCH V2 1/2] usb: typec: Support sprd_pmic_typec driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Xinhu,

kernel test robot noticed the following build warnings:

[auto build test WARNING on usb/usb-testing]
[also build test WARNING on usb/usb-next usb/usb-linus robh/for-next westeri-thunderbolt/next linus/master v6.7-rc5 next-20231211]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Xinhu-Wu/usb-typec-Support-sprd_pmic_typec-driver/20231211-154328
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
patch link:    https://lore.kernel.org/r/20231211074120.27958-2-xinhu.wu%40unisoc.com
patch subject: [PATCH V2 1/2] usb: typec: Support sprd_pmic_typec driver
config: powerpc-allmodconfig (https://download.01.org/0day-ci/archive/20231212/202312120233.giTFvDie-lkp@xxxxxxxxx/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20231212/202312120233.giTFvDie-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312120233.giTFvDie-lkp@xxxxxxxxx/

All warnings (new ones prefixed by >>):

>> drivers/usb/typec/sprd_pmic_typec.c:184:10: warning: 16 enumeration values not handled in switch: 'TYPEC_DETACHED_SNK', 'TYPEC_ATTACHWAIT_SNK', 'TYPEC_DETACHED_SRC'... [-Wswitch]
     184 |         switch (sc->state) {
         |                 ^~~~~~~~~
   1 warning generated.


vim +184 drivers/usb/typec/sprd_pmic_typec.c

   173	
   174	static int sprd_pmic_typec_connect(struct sprd_pmic_typec *sc, u32 status)
   175	{
   176		enum typec_data_role data_role = TYPEC_DEVICE;
   177		enum typec_role power_role = TYPEC_SINK;
   178		enum typec_role vconn_role = TYPEC_SINK;
   179		struct typec_partner_desc desc;
   180	
   181		if (sc->partner)
   182			return 0;
   183	
 > 184		switch (sc->state) {
   185		case TYPEC_ATTACHED_SNK:
   186			power_role = TYPEC_SINK;
   187			data_role = TYPEC_DEVICE;
   188			vconn_role = TYPEC_SINK;
   189			break;
   190		case TYPEC_ATTACHED_SRC:
   191			power_role = TYPEC_SOURCE;
   192			data_role = TYPEC_HOST;
   193			vconn_role = TYPEC_SOURCE;
   194			break;
   195		}
   196	
   197		desc.usb_pd = 0;
   198		desc.identity = NULL;
   199		if (sc->state == TYPEC_AUDIO_CABLE)
   200			desc.accessory = TYPEC_ACCESSORY_AUDIO;
   201		else if (sc->state == TYPEC_DEBUG_CABLE)
   202			desc.accessory = TYPEC_ACCESSORY_DEBUG;
   203		else
   204			desc.accessory = TYPEC_ACCESSORY_NONE;
   205	
   206		sc->partner = typec_register_partner(sc->port, &desc);
   207		if (!sc->partner)
   208			return -ENODEV;
   209	
   210		typec_set_pwr_opmode(sc->port, TYPEC_PWR_MODE_USB);
   211		typec_set_pwr_role(sc->port, power_role);
   212		typec_set_data_role(sc->port, data_role);
   213		typec_set_vconn_role(sc->port, vconn_role);
   214	
   215		switch (sc->state) {
   216		case TYPEC_ATTACHED_SNK:
   217			sc->pre_state = TYPEC_ATTACHED_SNK;
   218			/*notify USB, USB PHY, charger, and bc1p2 driver*/
   219			extcon_set_state_sync(sc->edev, EXTCON_USB, true);
   220			break;
   221		case TYPEC_ATTACHED_SRC:
   222			sc->pre_state = TYPEC_ATTACHED_SRC;
   223			/*notify USB, USB PHY driver*/
   224			extcon_set_state_sync(sc->edev, EXTCON_USB_HOST, true);
   225			break;
   226		case TYPEC_AUDIO_CABLE:
   227			/*notify analog audio driver*/
   228			sc->pre_state = TYPEC_AUDIO_CABLE;
   229			extcon_set_state_sync(sc->edev, EXTCON_JACK_HEADPHONE, true);
   230			break;
   231		default:
   232			break;
   233		}
   234	
   235		spin_lock(&sc->lock);
   236		sc->partner_connected = true;
   237		spin_unlock(&sc->lock);
   238		sprd_pmic_typec_set_cc_polarity_role(sc);
   239	
   240		return 0;
   241	}
   242	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki




[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux