[PATCH] [stage-3.4] Next USB *HCI unification. Need to test on A13.

15 views
Skip to first unread message

Андрей Панов

unread,
Oct 20, 2012, 2:19:52 PM10/20/12
to linux...@googlegroups.com
Hello!

I've looked into pending changes at https://github.com/linux-sunxi/linux-sunxi/commit/863e8aa8d4eddcd9229d198d06d53a0e77ca8154 and here is a new patch that integrates some of that changes.
Clock handling code is now equal between A10 and A13, so it is easier to have one unified driver.

Need to test if it works on A13. 

And in pending is a strange part of code, that is working with power regulator doesn't belonging to USB, like this:

static u32 alloc_pin(struct sw_hci_hcd *sw_hci, user_gpio_set_t *gpio_list)
{
    u32 pin_handle = 0;
    char name[32];

    memset(name, 0, 32);

    if(gpio_list->port == 0xffff){  //axp
        if(gpio_list->port_num >= USB_EXTERN_PIN_LDO_MASK){
#ifdef  CONFIG_REGULATOR
            switch((gpio_list->port_num - USB_EXTERN_PIN_LDO_MASK)){
                case 1:
                    strcpy(name, "axp20_rtc");
                break;

                case 2:
                    strcpy(name, "axp20_analog/fm");
                break;

                case 3:
                    strcpy(name, "axp20_pll");
                break;

                case 4:
                    strcpy(name, "axp20_hdmi");
                break;

                default:
                    DMSG_PANIC("ERR: unkown gpio_list->port_num(%d)\n", gpio_list->port_num);
                    goto failed;
            }

            pin_handle = (u32)regulator_get(NULL, name);
            if(pin_handle == 0){
                DMSG_PANIC("ERR: regulator_get failed\n");
                return 0;
            }

            regulator_force_disable((struct regulator*)pin_handle);
#else
DMSG_PANIC("CONFIG_REGULATOR is not define\n");
#endif
        }else{
            axp_gpio_set_io(gpio_list->port_num, gpio_list->mul_sel);
            axp_gpio_set_value(gpio_list->port_num, gpio_list->data);

            return (100 + gpio_list->port_num);
        }
}else{  //gpio
        pin_handle = gpio_request(gpio_list, 1);
        if(pin_handle == 0){
            DMSG_PANIC("ERR: gpio_request failed\n");
            return 0;
        }

        /* set config, ouput */
        gpio_set_one_pin_io_status(pin_handle, 1, NULL);

        /* reserved is pull down */
        gpio_set_one_pin_pull(pin_handle, 2, NULL);
}

failed:
return pin_handle;
}

I believe that USB driver should not to mess with HDMI or others. So it is still in pending.

--
Andrey

usb2.diff
Reply all
Reply to author
Forward
0 new messages