A method of an operation in an electronic device, the method comprising: receiving, from a host device connected to the electronic device through a universal serial bus, USB, setup data comprising a plurality of fields during a USB enumeration process identifying that each of a request type field and an application field included in the plurality of fields is set to a value indicating that a type of the host device corresponds to a designated type corresponding to a head unit of a vehicle; enabling, in response to the identifying, a first protocol for the USB; and communicating with the host device through the USB based on the first protocol, characterized in that the method further comprises: receiving, from another host device connected to the electronic device through the USB, information indicating that the another host device supports a second mode among a plurality of modes included in a USB mode, wherein a first mode among the plurality of modes provides a single-configuration, and wherein the second mode among the plurality of modes provides a multiple-configuration; setting the USB mode as the second mode indicated by the information; after setting the USB mode as the second mode, detecting a user input for switching the USB mode to the first mode; and based on the detection, performing the USB enumeration process with the another host device again to switch the USB mode to the first mode. receiving, from a host device connected to the electronic device through a universal serial bus, USB, setup data comprising a plurality of fields during a USB enumeration process identifying that each of a request type field and an application field included in the plurality of fields is set to a value indicating that a type of the host device corresponds to a designated type corresponding to a head unit of a vehicle; enabling, in response to the identifying, a first protocol for the USB; and communicating with the host device through the USB based on the first protocol, characterized in that the method further comprises: receiving, from another host device connected to the electronic device through the USB, information indicating that the another host device supports a second mode among a plurality of modes included in a USB mode, wherein a first mode among the plurality of modes provides a single-configuration, and wherein the second mode among the plurality of modes provides a multiple-configuration; setting the USB mode as the second mode indicated by the information; after setting the USB mode as the second mode, detecting a user input for switching the USB mode to the first mode; and based on the detection, performing the USB enumeration process with the another host device again to switch the USB mode to the first mode. receiving, from another host device connected to the electronic device through the USB, information indicating that the another host device supports a second mode among a plurality of modes included in a USB mode, wherein a first mode among the plurality of modes provides a single-configuration, and wherein the second mode among the plurality of modes provides a multiple-configuration; setting the USB mode as the second mode indicated by the information; after setting the USB mode as the second mode, detecting a user input for switching the USB mode to the first mode; and based on the detection, performing the USB enumeration process with the another host device again to switch the USB mode to the first mode.