amd5536udc.h (b5a6a4e5baeff6a20a5c5e8711d8b08658efacbb) amd5536udc.h (97b3ffa233b94741ae77d6ece2476331935bf15b)
1/*
2 * amd5536.h -- header for AMD 5536 UDC high/full speed USB device controller
3 *
4 * Copyright (C) 2007 AMD (http://www.amd.com)
5 * Author: Thomas Dahlmann
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AMD5536UDC_H
14#define AMD5536UDC_H
15
1/*
2 * amd5536.h -- header for AMD 5536 UDC high/full speed USB device controller
3 *
4 * Copyright (C) 2007 AMD (http://www.amd.com)
5 * Author: Thomas Dahlmann
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 */
12
13#ifndef AMD5536UDC_H
14#define AMD5536UDC_H
15
16/* debug control */
17/* #define UDC_VERBOSE */
18
19#include <linux/usb/ch9.h>
20#include <linux/usb/gadget.h>
21
16/* various constants */
17#define UDC_RDE_TIMER_SECONDS 1
18#define UDC_RDE_TIMER_DIV 10
19#define UDC_POLLSTALL_TIMER_USECONDS 500
20
21/* Hs AMD5536 chip rev. */
22#define UDC_HSA0_REV 1
23#define UDC_HSB1_REV 2

--- 516 unchanged lines hidden (view full) ---

540 struct pci_dev *pdev;
541 struct udc_csrs __iomem *csr;
542 struct udc_regs __iomem *regs;
543 struct udc_ep_regs __iomem *ep_regs;
544 u32 __iomem *rxfifo;
545 u32 __iomem *txfifo;
546
547 /* DMA desc pools */
22/* various constants */
23#define UDC_RDE_TIMER_SECONDS 1
24#define UDC_RDE_TIMER_DIV 10
25#define UDC_POLLSTALL_TIMER_USECONDS 500
26
27/* Hs AMD5536 chip rev. */
28#define UDC_HSA0_REV 1
29#define UDC_HSB1_REV 2

--- 516 unchanged lines hidden (view full) ---

546 struct pci_dev *pdev;
547 struct udc_csrs __iomem *csr;
548 struct udc_regs __iomem *regs;
549 struct udc_ep_regs __iomem *ep_regs;
550 u32 __iomem *rxfifo;
551 u32 __iomem *txfifo;
552
553 /* DMA desc pools */
548 struct dma_pool *data_requests;
549 struct dma_pool *stp_requests;
554 struct pci_pool *data_requests;
555 struct pci_pool *stp_requests;
550
551 /* device data */
552 unsigned long phys_addr;
553 void __iomem *virt_addr;
554 unsigned irq;
555
556 /* states */
557 u16 cur_config;

--- 4 unchanged lines hidden (view full) ---

562#define to_amd5536_udc(g) (container_of((g), struct udc, gadget))
563
564/* setup request data */
565union udc_setup_data {
566 u32 data[2];
567 struct usb_ctrlrequest request;
568};
569
556
557 /* device data */
558 unsigned long phys_addr;
559 void __iomem *virt_addr;
560 unsigned irq;
561
562 /* states */
563 u16 cur_config;

--- 4 unchanged lines hidden (view full) ---

568#define to_amd5536_udc(g) (container_of((g), struct udc, gadget))
569
570/* setup request data */
571union udc_setup_data {
572 u32 data[2];
573 struct usb_ctrlrequest request;
574};
575
576/* Function declarations */
577int udc_enable_dev_setup_interrupts(struct udc *dev);
578int udc_mask_unused_interrupts(struct udc *dev);
579irqreturn_t udc_irq(int irq, void *pdev);
580void gadget_release(struct device *pdev);
581void udc_basic_init(struct udc *dev);
582void free_dma_pools(struct udc *dev);
583int init_dma_pools(struct udc *dev);
584void udc_remove(struct udc *dev);
585int udc_probe(struct udc *dev);
586
587/* DMA usage flag */
588static bool use_dma = 1;
589/* packet per buffer dma */
590static bool use_dma_ppb = 1;
591/* with per descr. update */
592static bool use_dma_ppb_du;
593/* full speed only mode */
594static bool use_fullspeed;
595
596/* module parameters */
597module_param(use_dma, bool, S_IRUGO);
598MODULE_PARM_DESC(use_dma, "true for DMA");
599module_param(use_dma_ppb, bool, S_IRUGO);
600MODULE_PARM_DESC(use_dma_ppb, "true for DMA in packet per buffer mode");
601module_param(use_dma_ppb_du, bool, S_IRUGO);
602MODULE_PARM_DESC(use_dma_ppb_du,
603 "true for DMA in packet per buffer mode with descriptor update");
604module_param(use_fullspeed, bool, S_IRUGO);
605MODULE_PARM_DESC(use_fullspeed, "true for fullspeed only");
570/*
571 *---------------------------------------------------------------------------
572 * SET and GET bitfields in u32 values
573 * via constants for mask/offset:
574 * <bit_field_stub_name> is the text between
575 * UDC_ and _MASK|_OFS of appropriate
576 * constant
577 *

--- 37 unchanged lines hidden ---
606/*
607 *---------------------------------------------------------------------------
608 * SET and GET bitfields in u32 values
609 * via constants for mask/offset:
610 * <bit_field_stub_name> is the text between
611 * UDC_ and _MASK|_OFS of appropriate
612 * constant
613 *

--- 37 unchanged lines hidden ---