Changeset 11a3b5f in mainline


Ignore:
Timestamp:
2013-09-28T21:55:31Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0d4b110
Parents:
8064c2f6
Message:

uhci: Move legacy disabling to uhci.c

Location:
uspace/drv/bus/usb/uhci
Files:
2 deleted
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/Makefile

    r8064c2f6 r11a3b5f  
    4747        hc.c \
    4848        main.c \
    49         res.c \
    5049        transfer_list.c \
    5150        uhci.c \
  • uspace/drv/bus/usb/uhci/uhci.c

    r8064c2f6 r11a3b5f  
    3838#include <ddf/interrupt.h>
    3939#include <device/hw_res_parsed.h>
     40#include <device/pci.h>
     41#include <devman.h>
    4042#include <errno.h>
    4143#include <stdbool.h>
     
    5254#include "uhci.h"
    5355
    54 #include "res.h"
    5556#include "hc.h"
    5657
     
    7273        const uint16_t status = IPC_GET_ARG1(*call);
    7374        hc_interrupt(hcd->driver.data, status);
     75}
     76
     77/** Call the PCI driver with a request to clear legacy support register
     78 *
     79 * @param[in] device Device asking to disable interrupts
     80 * @return Error code.
     81 */
     82static int disable_legacy(ddf_dev_t *device)
     83{
     84        assert(device);
     85
     86        async_sess_t *parent_sess = devman_parent_device_connect(
     87            EXCHANGE_SERIALIZE, ddf_dev_get_handle(device), IPC_FLAG_BLOCKING);
     88        if (!parent_sess)
     89                return ENOMEM;
     90
     91        /* See UHCI design guide page 45 for these values.
     92         * Write all WC bits in USB legacy register */
     93        const int rc = pci_config_space_write_16(parent_sess, 0xc0, 0xaf00);
     94
     95        async_hangup(parent_sess);
     96        return rc;
    7497}
    7598
Note: See TracChangeset for help on using the changeset viewer.