An electronic device (401; 601), comprising: a first circuit (651a; 651b) configured to provide first power to a first external electronic device (402; 602); a second circuit (661a; 661b) configured to receive second power from the first external electronic device or a second external electronic device; a connector configured to be electrically connected to the first external electronic device or the second external electronic device, the connector including a configuration pin configured to selectively connect to the first circuit or the second circuit based on a first connection setting; and a processor configured to control the connector, the processor further configured to: control, based on the first connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, identify a second connection setting for controlling selectively connecting the configuration pin to the first circuit or to the second circuit based on at least one of context information related to the electronic device, context information related to the first external electronic device, or context information related to the second external electronic device, wherein the second connection setting is to set a first time of a first period during which the configuration pin is connected to the first circuit and a second time different from the first time of the first period during which the configuration pin is connected to the second circuit, and control, based on the second connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, wherein, when the electronic device is electrically connected with the first external electronic device or the second external electronic device via the connector, the processor is configured to identify that the electronic device operates in a host mode when the configuration pin is connected to the first circuit, and to identify that the electronic device operates in a client mode when the configuration pin is connected to the second circuit. a first circuit (651a; 651b) configured to provide first power to a first external electronic device (402; 602); a second circuit (661a; 661b) configured to receive second power from the first external electronic device or a second external electronic device; a connector configured to be electrically connected to the first external electronic device or the second external electronic device, the connector including a configuration pin configured to selectively connect to the first circuit or the second circuit based on a first connection setting; and a processor configured to control the connector, the processor further configured to: control, based on the first connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, identify a second connection setting for controlling selectively connecting the configuration pin to the first circuit or to the second circuit based on at least one of context information related to the electronic device, context information related to the first external electronic device, or context information related to the second external electronic device, wherein the second connection setting is to set a first time of a first period during which the configuration pin is connected to the first circuit and a second time different from the first time of the first period during which the configuration pin is connected to the second circuit, and control, based on the second connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, wherein, when the electronic device is electrically connected with the first external electronic device or the second external electronic device via the connector, the processor is configured to identify that the electronic device operates in a host mode when the configuration pin is connected to the first circuit, and to identify that the electronic device operates in a client mode when the configuration pin is connected to the second circuit. control, based on the first connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, identify a second connection setting for controlling selectively connecting the configuration pin to the first circuit or to the second circuit based on at least one of context information related to the electronic device, context information related to the first external electronic device, or context information related to the second external electronic device, wherein the second connection setting is to set a first time of a first period during which the configuration pin is connected to the first circuit and a second time different from the first time of the first period during which the configuration pin is connected to the second circuit, and control, based on the second connection setting, selectively connecting the configuration pin to the first circuit or to the second circuit, wherein, when the electronic device is electrically connected with the first external electronic device or the second external electronic device via the connector, the processor is configured to identify that the electronic device operates in a host mode when the configuration pin is connected to the first circuit, and to identify that the electronic device operates in a client mode when the configuration pin is connected to the second circuit.