dwc_otg_attr.c File Reference

The diagnostic interface will provide access to the controller for bringing up the hardware and testing. More...

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/init.h>
#include <linux/device.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/stat.h>
#include <linux/version.h>
#include <linux/param.h>
#include <linux/delay.h>
#include <linux/jiffies.h>
#include <asm/io.h>
#include "dwc_os.h"
#include "dwc_otg_driver.h"
#include "dwc_otg_attr.h"
#include "dwc_otg_core_if.h"
#include "dwc_otg_pcd_if.h"
#include "dwc_otg_hcd_if.h"

Go to the source code of this file.

Functions for Show/Store of Attributes

#define RW_REG_COUNT   10000000
 Displays the time required to read the GNPTXFSIZ register many times (the output shows the number of times the register is read).
#define MSEC_PER_JIFFIE   1000/HZ
static ssize_t regoffset_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the register offset of the Register Access.
static ssize_t regoffset_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Set the register offset for the next Register Access Read/Write.
static ssize_t regvalue_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the value of the register at the offset in the reg_offset attribute.
static ssize_t regvalue_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Store the value in the register at the offset in the reg_offset attribute.
 DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW (mode,"Mode")
static ssize_t hnp_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Set the HNP Request bit.
static ssize_t srp_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the SRP status bit.
static ssize_t srp_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Set the SRP Request bit.
static ssize_t buspower_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the Bus Power status.
static ssize_t buspower_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Set the Bus Power status.
static ssize_t bussuspend_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the Bus Suspend status.
static ssize_t bussuspend_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Set the Bus Suspend status.
static ssize_t remote_wakeup_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Show the status of Remote Wakeup.
static ssize_t remote_wakeup_store (struct device *_dev, struct device_attribute *attr, const char *buf, size_t count)
 Initiate a remote wakeup of the host.
static ssize_t regdump_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Dump global registers and either host or device registers (depending on the current mode of the core).
S_IRUGO static ssize_t spramdump_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Dump global registers and either host or device registers (depending on the current mode of the core).
S_IRUGO static ssize_t hcddump_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Dump the current hcd state.
S_IRUGO static ssize_t hcd_frrem_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Dump the average frame remaining at SOF.
static ssize_t rd_reg_test_show (struct device *_dev, struct device_attribute *attr, char *buf)
S_IRUGO static ssize_t wr_reg_test_show (struct device *_dev, struct device_attribute *attr, char *buf)
 Displays the time required to write the GNPTXFSIZ register many times (the output shows the number of times the register is written).
 regoffset
S_IRUGO S_IWUSR
S_IRUGO regoffset_show
S_IRUGO regoffset_store
 regvalue
S_IRUGO S_IWUSR
S_IRUGO regvalue_show
S_IRUGO regvalue_store
 hnp
 hnp_show
 hnp_store
 srp
 srp_show
 srp_store
 buspower
 buspower_show
 buspower_store
 bussuspend
 bussuspend_show
 bussuspend_store
 remote_wakeup
S_IRUGO S_IWUSR
S_IRUGO remote_wakeup_show
S_IRUGO remote_wakeup_store
 regdump
S_IRUGO S_IWUSR
S_IRUGO regdump_show
 spramdump
S_IRUGO S_IWUSR
S_IRUGO spramdump_show
 hcddump
S_IRUGO S_IWUSR
S_IRUGO hcddump_show
 hcd_frrem
S_IRUGO S_IWUSR
S_IRUGO hcd_frrem_show
 rd_reg_test
S_IRUGO S_IWUSR
S_IRUGO rd_reg_test_show
 wr_reg_test
S_IRUGO S_IWUSR
S_IRUGO wr_reg_test_show

Defines

#define DWC_OTG_DEVICE_ATTR_BITFIELD_RW(_otg_attr_name_, _string_)
#define DWC_OTG_DEVICE_ATTR_BITFIELD_RO(_otg_attr_name_, _string_)
#define DWC_OTG_DEVICE_ATTR_REG32_RW(_otg_attr_name_, _addr_, _string_)
#define DWC_OTG_DEVICE_ATTR_REG32_RO(_otg_attr_name_, _addr_, _string_)

Functions

S_IRUGO void dwc_otg_attr_create ()
 Create the device files.
void dwc_otg_attr_remove ()
 Remove the device files.


Detailed Description

The diagnostic interface will provide access to the controller for bringing up the hardware and testing.

The Linux driver attributes feature will be used to provide the Linux Diagnostic Interface. These attributes are accessed through sysfs.

Definition in file dwc_otg_attr.c.


Define Documentation

#define DWC_OTG_DEVICE_ATTR_BITFIELD_RW ( _otg_attr_name_,
_string_   ) 

Value:

DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW(_otg_attr_name_,_string_) \
DWC_OTG_DEVICE_ATTR_BITFIELD_STORE(_otg_attr_name_,_string_) \
DEVICE_ATTR(_otg_attr_name_,0644,_otg_attr_name_##_show,_otg_attr_name_##_store);

Definition at line 405 of file dwc_otg_attr.c.

#define DWC_OTG_DEVICE_ATTR_BITFIELD_RO ( _otg_attr_name_,
_string_   ) 

Value:

DWC_OTG_DEVICE_ATTR_BITFIELD_SHOW(_otg_attr_name_,_string_) \
DEVICE_ATTR(_otg_attr_name_,0444,_otg_attr_name_##_show,NULL);

Definition at line 410 of file dwc_otg_attr.c.

#define DWC_OTG_DEVICE_ATTR_REG32_RW ( _otg_attr_name_,
_addr_,
_string_   ) 

Value:

DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_string_) \
DWC_OTG_DEVICE_ATTR_REG_STORE(_otg_attr_name_,_string_) \
DEVICE_ATTR(_otg_attr_name_,0644,_otg_attr_name_##_show,_otg_attr_name_##_store);

Definition at line 414 of file dwc_otg_attr.c.

#define DWC_OTG_DEVICE_ATTR_REG32_RO ( _otg_attr_name_,
_addr_,
_string_   ) 

Value:

DWC_OTG_DEVICE_ATTR_REG_SHOW(_otg_attr_name_,_string_) \
DEVICE_ATTR(_otg_attr_name_,0444,_otg_attr_name_##_show,NULL);

Definition at line 419 of file dwc_otg_attr.c.


Function Documentation

static ssize_t remote_wakeup_store ( struct device *  _dev,
struct device_attribute *  attr,
const char *  buf,
size_t  count 
) [static]

Initiate a remote wakeup of the host.

The Device control register Remote Wakeup Signal bit is written if the PCD Remote wakeup enable flag is set.

Definition at line 773 of file dwc_otg_attr.c.

S_IRUGO static ssize_t hcd_frrem_show ( struct device *  _dev,
struct device_attribute *  attr,
char *  buf 
) [static]

Dump the average frame remaining at SOF.

This can be used to determine average interrupt latency. Frame remaining is also shown for start transfer and two additional sample points.

Definition at line 872 of file dwc_otg_attr.c.


Generated on Tue May 5 02:22:48 2009 for DesignWare USB 2.0 OTG Controller (DWC_otg) Device Driver by  doxygen 1.4.7