usb: xhci: tegra: support hsic dt config
Krishna Yarlagadda [Wed, 13 Nov 2013 08:52:29 +0000 (13:52 +0530)]
Changes to read hsic cofig data from dt and change header
to have all u8 values which simplifies parsing dt

Bug 1342607

Change-Id: I0c547a32a347e561eccd35acc16c824cd105e69c
Signed-off-by: Krishna Yarlagadda <kyarlagadda@nvidia.com>
Reviewed-on: http://git-master/r/330163
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>

arch/arm/mach-tegra/include/mach/xusb.h
drivers/usb/host/xhci-tegra.c

index 401e985..cd073fd 100644 (file)
@@ -59,6 +59,7 @@ struct tegra_xusb_regulator_name {
        const char *s1p05v;
 };
 
+/* Ensure dt compatiblity when changing order */
 struct tegra_xusb_hsic_config {
        u8 rx_strobe_trim;
        u8 rx_data_trim;
@@ -66,9 +67,9 @@ struct tegra_xusb_hsic_config {
        u8 tx_rtune_p;
        u8 tx_slew_n;
        u8 tx_slew_p;
-       bool auto_term_en;
+       u8 auto_term_en;
        u8 strb_trim_val;
-       bool pretend_connect;
+       u8 pretend_connect;
 };
 
 struct tegra_xusb_board_data {
index 9823ff9..a5aa584 100644 (file)
@@ -4183,9 +4183,13 @@ static void tegra_xusb_read_board_data(struct tegra_xhci_hcd *tegra)
                                        &bdata->supply.vddio_hsic);
        ret = of_property_read_string(node, "nvidia,supply_s1p05v",
                                        &bdata->supply.s1p05v);
-       /* TODO: add read for tegra_xusb_hsic_config
-        * Add error conditions check
-        */
+       ret = of_property_read_u8_array(node, "nvidia,hsic0",
+                                       (u8 *) &bdata->hsic[0],
+                                       sizeof(bdata->hsic[0]));
+       ret = of_property_read_u8_array(node, "nvidia,hsic1",
+                                       (u8 *) &bdata->hsic[1],
+                                       sizeof(bdata->hsic[0]));
+       /* TODO: Add error conditions check */
 }
 
 static void tegra_xusb_read_calib_data(struct tegra_xhci_hcd *tegra)
@@ -4309,6 +4313,8 @@ static int tegra_xhci_probe(struct platform_device *pdev)
        tegra_xusb_read_board_data(tegra);
        tegra->pdata = dev_get_platdata(&pdev->dev);
        tegra->bdata->portmap = tegra->pdata->portmap;
+       tegra->bdata->hsic[0].pretend_connect =
+                               tegra->pdata->pretend_connect_0;
        if (tegra->bdata->portmap == NULL)
                return -ENODEV;
        tegra->bdata->lane_owner = tegra->pdata->lane_owner;