6/22/2012

How can I switch HS USB composition without resetting the device in Qualcomm MDM8200?

Q) How can I switch HS USB composition without resetting the device in Jungo code?
or

Q) Looking for information about the hsu_set_compositon() API?
or
Q)What are API's help in the HS USB composition switching?

A) Switching HS USB composition without resetting the device is called the hs-usb dynamic switching of composition. For static switching OEM's need to change the NV#4526 value and reset the device. Please check the composition_details[] to know the all the compositions supported.

Dynamic Composition Switching:
There are two set of APIs supporting the dynamic switching
1) hsu_set_compositon() from the Hsu_conf_sel_rdm.c file(NEW API).
2) hsu_conf_sel_ui_switch_comp() from the file Hsu_con_sel_ui.c(OLD API).

General steps followed to switch the composition:
1) Closing ports: All the ports opened in the current composition is closed with rdm_assing_port()/rdm_close_device().
2) Stack Switching: Switch the HS USB stack to support the new set of Functional drivers in the target composition. hsu_conf_sel_switch_dev_stack() does the switching of the HS USB stack.
3) Opening ports: Open each port in the target composition with rdm_assign_port().


1) Note1: hsu_set_composition() function and all its related functions are listed in Hsu_conf_sel_rdm.c file.
2) Note2: hsu_conf_sel_ui_switch_comp() and all it related functions are listed in Hsu_conf_sel_ui.c file.
3) Note3: if you find any port is not working after using the hsu_conf_sel_ui_switch_comp(), please open a CASE.







Supplement to the solution on February 19, 2010:


We have 2 options to perform dynamic switch and we don't recommend using hsu_conf_sel_ui_switch_comp.

Option 1 :
Call hsu_conf_sel_switch_dev_stack and rdm_assign_port directly from application. For this application, it should be assured that the hsu_conf_sel_switch_dev_stack and rdm_assign_port are called from the application context.

Example sequence as follows.
a. Application task call hsu_conf_sel_switch_dev_stack with call back, switch_dev_cb.
b. Application task wait until switch_dev_cb is called. (eg: rex_wait and rex_set_sigs can be used.).
c. switch_dev_cb is called by HS_USB0 task and notify application task of the completion of comp switch.




* Application task call hsu_api_spoof_reconnect(). Only valid for QSC11x0 which has enabled the feature FEATURE_HS_USB_PMIC_PHY.



d. Application task calls rdm_assign_port with rdm_cb.
e. Application task wait unitl rdm_cb is called.
f. rdm_cb is called by some task( The caller on rdm_cb varies depending on the service) and notify application task of the completion rdm_assign_port.
h. Application repeats from step d to step f.

Option 2 :
Use new API hsu_set_composton which has been submitted recently.

void hsu_set_compositon
(
hsu_conf_sel_composition_id_enum composition_id,
hsu_set_comp_cb_type complete_cb,
hsu_rdm_dev_svc_pare_type *old_rdm_map,
juint8_t old_rdm_map_size,
hsu_rdm_dev_svc_pare_type *new_rdm_map,
juint8_t new_rdm_map_size
);

Example usage is :

Hsu_rdm_dev_srv_pare_type new_rdm_map[2] = {
{RDM_USB_DIAG_DEV,RDM_DIAG_SRVC},
{RDM_USB_MDM_DEV,RDM_DATA_SRVC}
}

Void complete_cb(boolean status)
{
hsu_api_spoof_reconnect();


* Only valid for QSC11x0 which has enabled the feature FEATURE_HS_USB_PMIC_PHY.
}

Application context :

hsu_set_compositon(
HSU_CONF_SEL_DIAG_MDM_COMP,
complete_cb,
NULL,
NULL,
new_rdm_map,
2
);

We redommand option 1 for the targets which does not have the API.

No comments:

Post a Comment