FreeBSD kernel usb device Code
wsp.c File Reference
#include <sys/cdefs.h>
#include "opt_evdev.h"
#include <sys/param.h>
#include <sys/systm.h>
#include <sys/kernel.h>
#include <sys/malloc.h>
#include <sys/module.h>
#include <sys/lock.h>
#include <sys/mutex.h>
#include <sys/bus.h>
#include <sys/conf.h>
#include <sys/fcntl.h>
#include <sys/file.h>
#include <sys/selinfo.h>
#include <sys/poll.h>
#include <sys/sysctl.h>
#include <dev/hid/hid.h>
#include <dev/usb/usb.h>
#include <dev/usb/usbdi.h>
#include <dev/usb/usbdi_util.h>
#include <dev/usb/usbhid.h>
#include "usbdevs.h"
#include <dev/usb/usb_debug.h>
#include <sys/mouse.h>
Include dependency graph for wsp.c:

Go to the source code of this file.

Data Structures

struct  wsp_tuning
 
struct  bt_data
 
struct  wsp_tp
 
struct  tp_header
 
struct  tp_finger
 
struct  wsp_param
 
struct  wsp_dev_params
 
struct  wsp_softc
 

Macros

#define USB_DEBUG_VAR   wsp_debug
 
#define WSP_DRIVER_NAME   "wsp"
 
#define WSP_BUFFER_MAX   1024
 
#define WSP_CLAMP(x, low, high)
 
#define FINGER_TYPE1   (13 * 2)
 
#define FINGER_TYPE2   (15 * 2)
 
#define FINGER_TYPE3   (19 * 2)
 
#define FINGER_TYPE4   (23 * 2)
 
#define BUTTON_TYPE2   15
 
#define BUTTON_TYPE3   23
 
#define BUTTON_TYPE4   31
 
#define HAS_INTEGRATED_BUTTON   1
 
#define FSIZE_TYPE1   (14 * 2)
 
#define FSIZE_TYPE2   (14 * 2)
 
#define FSIZE_TYPE3   (14 * 2)
 
#define FSIZE_TYPE4   (15 * 2)
 
#define MAX_FINGERS   16
 
#define SIZEOF_FINGER   sizeof(struct tp_finger)
 
#define SIZEOF_ALL_FINGERS   (MAX_FINGERS * SIZEOF_FINGER)
 
#define MAX_FINGER_ORIENTATION   16384
 
#define SN_PRESSURE   45 /* pressure signal-to-noise ratio */
 
#define SN_WIDTH   25 /* width signal-to-noise ratio */
 
#define SN_COORD   250 /* coordinate signal-to-noise ratio */
 
#define SN_ORIENT   10 /* orientation signal-to-noise ratio */
 
#define WSP_DEV(v, p, i)   { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }
 
#define WSP_FIFO_BUF_SIZE   8 /* bytes */
 
#define WSP_FIFO_QUEUE_MAXLEN   50 /* units */
 
#define WSP_ENABLED   0x01
 
#define WSP_EVDEV_OPENED   0x02
 
#define WSP_UNTOUCH   0x00
 
#define WSP_FIRST_TOUCH   0x01
 
#define WSP_SECOND_TOUCH   0x02
 
#define WSP_TOUCHING   0x04
 
#define WSP_DZ_MAX_COUNT   32
 
#define WSP_TAP_THRESHOLD   3
 
#define WSP_TAP_MAX_COUNT   20
 
#define MAX_DISTANCE   2500 /* the max allowed distance */
 
#define WSP_SCR_NONE   0
 
#define WSP_SCR_VER   1
 
#define WSP_SCR_HOR   2
 

Enumerations

enum  tp_type {
  TYPE1 , TYPE2 , TYPE3 , TYPE4 ,
  TYPE_CNT
}
 
enum  {
  WSP_FLAG_WELLSPRING1 , WSP_FLAG_WELLSPRING2 , WSP_FLAG_WELLSPRING3 , WSP_FLAG_WELLSPRING4 ,
  WSP_FLAG_WELLSPRING4A , WSP_FLAG_WELLSPRING5 , WSP_FLAG_WELLSPRING6A , WSP_FLAG_WELLSPRING6 ,
  WSP_FLAG_WELLSPRING5A , WSP_FLAG_WELLSPRING7 , WSP_FLAG_WELLSPRING7A , WSP_FLAG_WELLSPRING8 ,
  WSP_FLAG_WELLSPRING9 , WSP_FLAG_MAX
}
 
enum  { WSP_INTR_DT , WSP_N_TRANSFER }
 

Functions

 __FBSDID ("$FreeBSD$")
 
static SYSCTL_NODE (_hw_usb, OID_AUTO, wsp, CTLFLAG_RW|CTLFLAG_MPSAFE, 0, "USB wsp")
 
static void wsp_runing_rangecheck (struct wsp_tuning *ptun)
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, scale_factor, CTLFLAG_RWTUN, &wsp_tuning.scale_factor, 0, "movement scale factor")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, z_factor, CTLFLAG_RWTUN, &wsp_tuning.z_factor, 0, "Z-axis scale factor")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, z_invert, CTLFLAG_RWTUN, &wsp_tuning.z_invert, 0, "enable Z-axis inversion")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, pressure_touch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_touch_threshold, 0, "touch pressure threshold")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, pressure_untouch_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_untouch_threshold, 0, "untouch pressure threshold")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, pressure_tap_threshold, CTLFLAG_RWTUN, &wsp_tuning.pressure_tap_threshold, 0, "tap pressure threshold")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, scr_hor_threshold, CTLFLAG_RWTUN, &wsp_tuning.scr_hor_threshold, 0, "horizontal scrolling threshold")
 
 SYSCTL_INT (_hw_usb_wsp, OID_AUTO, enable_single_tap_clicks, CTLFLAG_RWTUN, &wsp_tuning.enable_single_tap_clicks, 0, "enable single tap clicks")
 
static int wsp_enable (struct wsp_softc *sc)
 
static void wsp_disable (struct wsp_softc *sc)
 
static void wsp_reset_buf (struct wsp_softc *sc)
 
static void wsp_add_to_queue (struct wsp_softc *, int, int, int, uint32_t)
 
static usb_error_t wsp_set_device_mode (struct wsp_softc *sc, uint8_t on)
 
static int wsp_probe (device_t self)
 
static int wsp_attach (device_t dev)
 
static int wsp_detach (device_t dev)
 
static void wsp_intr_callback (struct usb_xfer *xfer, usb_error_t error)
 
static void wsp_start_read (struct wsp_softc *sc)
 
static void wsp_stop_read (struct wsp_softc *sc)
 
static int wsp_open (struct usb_fifo *fifo, int fflags)
 
static void wsp_close (struct usb_fifo *fifo, int fflags)
 
static void wsp_fifo_start_read (struct usb_fifo *fifo)
 
static void wsp_fifo_stop_read (struct usb_fifo *fifo)
 
int wsp_ioctl (struct usb_fifo *fifo, u_long cmd, void *addr, int fflags)
 
 DRIVER_MODULE (wsp, uhub, wsp_driver, wsp_devclass, NULL, 0)
 
 MODULE_DEPEND (wsp, usb, 1, 1, 1)
 
 MODULE_DEPEND (wsp, hid, 1, 1, 1)
 
 MODULE_VERSION (wsp, 1)
 
 USB_PNP_HOST_INFO (wsp_devs)
 

Variables

static struct wsp_tuning wsp_tuning
 
struct bt_data __packed
 
struct wsp_tp wsp_tp [TYPE_CNT]
 
static const struct wsp_dev_params wsp_dev_params [WSP_FLAG_MAX]
 
static const STRUCT_USB_HOST_ID wsp_devs []
 
static usb_fifo_cmd_t wsp_fifo_start_read
 
static usb_fifo_cmd_t wsp_fifo_stop_read
 
static usb_fifo_open_t wsp_open
 
static usb_fifo_close_t wsp_close
 
static usb_fifo_ioctl_t wsp_ioctl
 
static struct usb_fifo_methods wsp_fifo_methods
 
static device_probe_t wsp_probe
 
static device_attach_t wsp_attach
 
static device_detach_t wsp_detach
 
static usb_callback_t wsp_intr_callback
 
static const struct usb_config wsp_config [WSP_N_TRANSFER]
 
static device_method_t wsp_methods []
 
static driver_t wsp_driver
 
static devclass_t wsp_devclass
 

Macro Definition Documentation

◆ BUTTON_TYPE2

#define BUTTON_TYPE2   15

Definition at line 190 of file wsp.c.

◆ BUTTON_TYPE3

#define BUTTON_TYPE3   23

Definition at line 191 of file wsp.c.

◆ BUTTON_TYPE4

#define BUTTON_TYPE4   31

Definition at line 192 of file wsp.c.

◆ FINGER_TYPE1

#define FINGER_TYPE1   (13 * 2)

Definition at line 184 of file wsp.c.

◆ FINGER_TYPE2

#define FINGER_TYPE2   (15 * 2)

Definition at line 185 of file wsp.c.

◆ FINGER_TYPE3

#define FINGER_TYPE3   (19 * 2)

Definition at line 186 of file wsp.c.

◆ FINGER_TYPE4

#define FINGER_TYPE4   (23 * 2)

Definition at line 187 of file wsp.c.

◆ FSIZE_TYPE1

#define FSIZE_TYPE1   (14 * 2)

Definition at line 198 of file wsp.c.

◆ FSIZE_TYPE2

#define FSIZE_TYPE2   (14 * 2)

Definition at line 199 of file wsp.c.

◆ FSIZE_TYPE3

#define FSIZE_TYPE3   (14 * 2)

Definition at line 200 of file wsp.c.

◆ FSIZE_TYPE4

#define FSIZE_TYPE4   (15 * 2)

Definition at line 201 of file wsp.c.

◆ HAS_INTEGRATED_BUTTON

#define HAS_INTEGRATED_BUTTON   1

Definition at line 195 of file wsp.c.

◆ MAX_DISTANCE

#define MAX_DISTANCE   2500 /* the max allowed distance */

Definition at line 595 of file wsp.c.

◆ MAX_FINGER_ORIENTATION

#define MAX_FINGER_ORIENTATION   16384

Definition at line 305 of file wsp.c.

◆ MAX_FINGERS

#define MAX_FINGERS   16

Definition at line 301 of file wsp.c.

◆ SIZEOF_ALL_FINGERS

#define SIZEOF_ALL_FINGERS   (MAX_FINGERS * SIZEOF_FINGER)

Definition at line 304 of file wsp.c.

◆ SIZEOF_FINGER

#define SIZEOF_FINGER   sizeof(struct tp_finger)

Definition at line 303 of file wsp.c.

◆ SN_COORD

#define SN_COORD   250 /* coordinate signal-to-noise ratio */

Definition at line 349 of file wsp.c.

◆ SN_ORIENT

#define SN_ORIENT   10 /* orientation signal-to-noise ratio */

Definition at line 350 of file wsp.c.

◆ SN_PRESSURE

#define SN_PRESSURE   45 /* pressure signal-to-noise ratio */

Definition at line 347 of file wsp.c.

◆ SN_WIDTH

#define SN_WIDTH   25 /* width signal-to-noise ratio */

Definition at line 348 of file wsp.c.

◆ USB_DEBUG_VAR

#define USB_DEBUG_VAR   wsp_debug

Definition at line 58 of file wsp.c.

◆ WSP_BUFFER_MAX

#define WSP_BUFFER_MAX   1024

Definition at line 69 of file wsp.c.

◆ WSP_CLAMP

#define WSP_CLAMP (   x,
  low,
  high 
)
Value:
do { \
if ((x) < (low)) \
(x) = (low); \
else if ((x) > (high)) \
(x) = (high); \
} while (0)

Definition at line 71 of file wsp.c.

◆ WSP_DEV

#define WSP_DEV (   v,
  p,
 
)    { USB_VPI(USB_VENDOR_##v, USB_PRODUCT_##v##_##p, i) }

Definition at line 471 of file wsp.c.

◆ WSP_DRIVER_NAME

#define WSP_DRIVER_NAME   "wsp"

Definition at line 68 of file wsp.c.

◆ WSP_DZ_MAX_COUNT

#define WSP_DZ_MAX_COUNT   32

Definition at line 583 of file wsp.c.

◆ WSP_ENABLED

#define WSP_ENABLED   0x01

Definition at line 566 of file wsp.c.

◆ WSP_EVDEV_OPENED

#define WSP_EVDEV_OPENED   0x02

Definition at line 567 of file wsp.c.

◆ WSP_FIFO_BUF_SIZE

#define WSP_FIFO_BUF_SIZE   8 /* bytes */

Definition at line 541 of file wsp.c.

◆ WSP_FIFO_QUEUE_MAXLEN

#define WSP_FIFO_QUEUE_MAXLEN   50 /* units */

Definition at line 542 of file wsp.c.

◆ WSP_FIRST_TOUCH

#define WSP_FIRST_TOUCH   0x01

Definition at line 574 of file wsp.c.

◆ WSP_SCR_HOR

#define WSP_SCR_HOR   2

Definition at line 601 of file wsp.c.

◆ WSP_SCR_NONE

#define WSP_SCR_NONE   0

Definition at line 599 of file wsp.c.

◆ WSP_SCR_VER

#define WSP_SCR_VER   1

Definition at line 600 of file wsp.c.

◆ WSP_SECOND_TOUCH

#define WSP_SECOND_TOUCH   0x02

Definition at line 575 of file wsp.c.

◆ WSP_TAP_MAX_COUNT

#define WSP_TAP_MAX_COUNT   20

Definition at line 593 of file wsp.c.

◆ WSP_TAP_THRESHOLD

#define WSP_TAP_THRESHOLD   3

Definition at line 592 of file wsp.c.

◆ WSP_TOUCHING

#define WSP_TOUCHING   0x04

Definition at line 576 of file wsp.c.

◆ WSP_UNTOUCH

#define WSP_UNTOUCH   0x00

Definition at line 573 of file wsp.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
WSP_FLAG_WELLSPRING1 
WSP_FLAG_WELLSPRING2 
WSP_FLAG_WELLSPRING3 
WSP_FLAG_WELLSPRING4 
WSP_FLAG_WELLSPRING4A 
WSP_FLAG_WELLSPRING5 
WSP_FLAG_WELLSPRING6A 
WSP_FLAG_WELLSPRING6 
WSP_FLAG_WELLSPRING5A 
WSP_FLAG_WELLSPRING7 
WSP_FLAG_WELLSPRING7A 
WSP_FLAG_WELLSPRING8 
WSP_FLAG_WELLSPRING9 
WSP_FLAG_MAX 

Definition at line 311 of file wsp.c.

◆ anonymous enum

anonymous enum
Enumerator
WSP_INTR_DT 
WSP_N_TRANSFER 

Definition at line 544 of file wsp.c.

◆ tp_type

enum tp_type
Enumerator
TYPE1 
TYPE2 
TYPE3 
TYPE4 
TYPE_CNT 

Definition at line 175 of file wsp.c.

Function Documentation

◆ __FBSDID()

__FBSDID ( "$FreeBSD$"  )

◆ DRIVER_MODULE()

DRIVER_MODULE ( wsp  ,
uhub  ,
wsp_driver  ,
wsp_devclass  ,
NULL  ,
 
)

◆ MODULE_DEPEND() [1/2]

MODULE_DEPEND ( wsp  ,
hid  ,
,
,
 
)

◆ MODULE_DEPEND() [2/2]

MODULE_DEPEND ( wsp  ,
usb  ,
,
,
 
)

◆ MODULE_VERSION()

MODULE_VERSION ( wsp  ,
 
)

◆ SYSCTL_INT() [1/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
enable_single_tap_clicks  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  enable_single_tap_clicks,
,
"enable single tap clicks"   
)

◆ SYSCTL_INT() [2/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
pressure_tap_threshold  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  pressure_tap_threshold,
,
"tap pressure threshold"   
)

◆ SYSCTL_INT() [3/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
pressure_touch_threshold  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  pressure_touch_threshold,
,
"touch pressure threshold"   
)

◆ SYSCTL_INT() [4/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
pressure_untouch_threshold  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  pressure_untouch_threshold,
,
"untouch pressure threshold"   
)

◆ SYSCTL_INT() [5/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
scale_factor  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  scale_factor,
,
"movement scale factor"   
)

◆ SYSCTL_INT() [6/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
scr_hor_threshold  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  scr_hor_threshold,
,
"horizontal scrolling threshold"   
)

◆ SYSCTL_INT() [7/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
z_factor  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  z_factor,
,
"Z-axis scale factor"   
)

◆ SYSCTL_INT() [8/8]

SYSCTL_INT ( _hw_usb_wsp  ,
OID_AUTO  ,
z_invert  ,
CTLFLAG_RWTUN  ,
&wsp_tuning.  z_invert,
,
"enable Z-axis inversion"   
)

◆ SYSCTL_NODE()

static SYSCTL_NODE ( _hw_usb  ,
OID_AUTO  ,
wsp  ,
CTLFLAG_RW|  CTLFLAG_MPSAFE,
,
"USB wsp"   
)
static

◆ USB_PNP_HOST_INFO()

USB_PNP_HOST_INFO ( wsp_devs  )

◆ wsp_add_to_queue()

static void wsp_add_to_queue ( struct wsp_softc sc,
int  dx,
int  dy,
int  dz,
uint32_t  buttons_in 
)
static

Definition at line 1295 of file wsp.c.

References usb_fifo_sc::fp, wsp_softc::sc_fifo, wsp_softc::sc_mode, usb_fifo_put_data_linear(), and USB_FIFO_RX.

Referenced by wsp_intr_callback().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsp_attach()

◆ wsp_close()

static void wsp_close ( struct usb_fifo fifo,
int  fflags 
)
static

Definition at line 1398 of file wsp.c.

References wsp_softc::sc_fflags, wsp_softc::sc_state, usb_fifo_free_buffer(), usb_fifo_softc(), wsp_disable(), and WSP_EVDEV_OPENED.

Here is the call graph for this function:

◆ wsp_detach()

static int wsp_detach ( device_t  dev)
static

◆ wsp_disable()

static void wsp_disable ( struct wsp_softc sc)
static

Definition at line 708 of file wsp.c.

References wsp_softc::sc_state.

Referenced by wsp_close(), and wsp_detach().

Here is the caller graph for this function:

◆ wsp_enable()

static int wsp_enable ( struct wsp_softc sc)
static

Definition at line 697 of file wsp.c.

References wsp_softc::sc_state, wsp_softc::sc_status, and WSP_ENABLED.

Referenced by wsp_open().

Here is the caller graph for this function:

◆ wsp_fifo_start_read()

static void wsp_fifo_start_read ( struct usb_fifo fifo)
static

Definition at line 1414 of file wsp.c.

References usb_fifo_softc(), and wsp_start_read().

Here is the call graph for this function:

◆ wsp_fifo_stop_read()

static void wsp_fifo_stop_read ( struct usb_fifo fifo)
static

Definition at line 1422 of file wsp.c.

References wsp_softc::sc_state, usb_fifo_softc(), WSP_EVDEV_OPENED, and wsp_stop_read().

Here is the call graph for this function:

◆ wsp_intr_callback()

static void wsp_intr_callback ( struct usb_xfer xfer,
usb_error_t  error 
)
static

Definition at line 923 of file wsp.c.

References tp_finger::abs_x, tp_finger::abs_y, wsp_tp::button, wsp_tp::caps, wsp_tp::delta, wsp_softc::distance, wsp_softc::dt_sum, wsp_softc::dx_sum, wsp_softc::dy_sum, wsp_softc::dz_count, wsp_softc::dz_sum, wsp_tuning::enable_single_tap_clicks, error, wsp_softc::finger, usb_fifo_sc::fp, wsp_tp::fsize, HAS_INTEGRATED_BUTTON, tp_header::ibt, wsp_softc::ibtn, wsp_softc::index, wsp_softc::intr_count, len, wsp_param::max, MAX_DISTANCE, MAX_FINGERS, wsp_param::min, tp_finger::multi, wsp_softc::ntaps, wsp_dev_params::o, wsp_softc::o_ntouch, wsp_tp::offset, tp_finger::orientation, tp_finger::origin, wsp_softc::pos_x, wsp_softc::pos_y, wsp_softc::pre_pos_x, wsp_softc::pre_pos_y, tp_finger::pressure, wsp_tuning::pressure_tap_threshold, wsp_tuning::pressure_touch_threshold, wsp_tuning::pressure_untouch_threshold, wsp_softc::rdx, wsp_softc::rdy, wsp_softc::rdz, tp_finger::rel_x, tp_finger::rel_y, wsp_softc::sc_fifo, wsp_softc::sc_params, wsp_softc::sc_status, wsp_softc::sc_touch, wsp_tuning::scale_factor, wsp_tuning::scr_hor_threshold, wsp_softc::scr_mode, slot, tp_finger::tool_major, tp_finger::tool_minor, tp_finger::touch_major, tp_finger::touch_minor, wsp_dev_params::tp, wsp_softc::tp_datalen, TYPE1, USB_ERR_CANCELLED, usb_fifo_put_bytes_max(), USB_FIFO_RX, USB_GET_STATE, USB_ST_SETUP, USB_ST_TRANSFERRED, usbd_copy_out(), usbd_transfer_submit(), usbd_xfer_get_frame(), usbd_xfer_set_frame_len(), usbd_xfer_set_stall(), usbd_xfer_softc(), usbd_xfer_status(), wsp_add_to_queue(), WSP_DZ_MAX_COUNT, WSP_FIRST_TOUCH, wsp_runing_rangecheck(), WSP_SCR_HOR, WSP_SCR_NONE, WSP_SCR_VER, WSP_SECOND_TOUCH, WSP_TAP_MAX_COUNT, WSP_TAP_THRESHOLD, WSP_TOUCHING, wsp_tuning, WSP_UNTOUCH, wsp_dev_params::y, wsp_tuning::z_factor, and wsp_tuning::z_invert.

Here is the call graph for this function:

◆ wsp_ioctl()

int wsp_ioctl ( struct usb_fifo fifo,
u_long  cmd,
void *  addr,
int  fflags 
)

Definition at line 1467 of file wsp.c.

References addr, error, wsp_softc::sc_hw, wsp_softc::sc_mode, wsp_softc::sc_mutex, wsp_softc::sc_pollrate, wsp_softc::sc_status, status, usb_fifo_softc(), and wsp_reset_buf().

Here is the call graph for this function:

◆ wsp_open()

static int wsp_open ( struct usb_fifo fifo,
int  fflags 
)
static

◆ wsp_probe()

static int wsp_probe ( device_t  self)
static

◆ wsp_reset_buf()

static void wsp_reset_buf ( struct wsp_softc sc)
static

Definition at line 1334 of file wsp.c.

References usb_fifo_sc::fp, wsp_softc::sc_fifo, usb_fifo_reset(), and USB_FIFO_RX.

Referenced by wsp_ioctl().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsp_runing_rangecheck()

◆ wsp_set_device_mode()

static usb_error_t wsp_set_device_mode ( struct wsp_softc sc,
uint8_t  on 
)
static

◆ wsp_start_read()

static void wsp_start_read ( struct wsp_softc sc)
static

Definition at line 1341 of file wsp.c.

References wsp_softc::sc_pollrate, wsp_softc::sc_xfer, usbd_transfer_start(), usbd_transfer_stop(), usbd_xfer_set_interval(), and WSP_INTR_DT.

Referenced by wsp_fifo_start_read().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wsp_stop_read()

static void wsp_stop_read ( struct wsp_softc sc)
static

Definition at line 1363 of file wsp.c.

References wsp_softc::sc_xfer, usbd_transfer_stop(), and WSP_INTR_DT.

Referenced by wsp_fifo_stop_read().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ __packed

◆ wsp_attach

device_attach_t wsp_attach
static

Definition at line 642 of file wsp.c.

◆ wsp_close

usb_fifo_close_t wsp_close
static

Definition at line 611 of file wsp.c.

◆ wsp_config

const struct usb_config wsp_config[WSP_N_TRANSFER]
static
Initial value:
= {
.type = UE_INTERRUPT,
.endpoint = UE_ADDR_ANY,
.direction = UE_DIR_IN,
.flags = {
.pipe_bof = 0,
.short_xfer_ok = 1,
},
.bufsize = WSP_BUFFER_MAX,
.callback = &wsp_intr_callback,
},
}
#define UE_INTERRUPT
Definition: usb.h:544
#define UE_ADDR_ANY
Definition: usb.h:537
#define UE_DIR_IN
Definition: usb.h:531
#define WSP_BUFFER_MAX
Definition: wsp.c:69
@ WSP_INTR_DT
Definition: wsp.c:545
static usb_callback_t wsp_intr_callback
Definition: wsp.c:644

Definition at line 646 of file wsp.c.

Referenced by wsp_attach().

◆ wsp_detach

device_detach_t wsp_detach
static

Definition at line 643 of file wsp.c.

Referenced by wsp_attach().

◆ wsp_dev_params

Definition at line 352 of file wsp.c.

◆ wsp_devclass

devclass_t wsp_devclass
static

Definition at line 1572 of file wsp.c.

◆ wsp_devs

const STRUCT_USB_HOST_ID wsp_devs[]
static

Definition at line 473 of file wsp.c.

Referenced by wsp_probe().

◆ wsp_driver

driver_t wsp_driver
static
Initial value:
= {
.name = WSP_DRIVER_NAME,
.methods = wsp_methods,
.size = sizeof(struct wsp_softc)
}
Definition: wsp.c:549
static device_method_t wsp_methods[]
Definition: wsp.c:1558
#define WSP_DRIVER_NAME
Definition: wsp.c:68

Definition at line 1566 of file wsp.c.

◆ wsp_fifo_methods

struct usb_fifo_methods wsp_fifo_methods
static
Initial value:
= {
.f_open = &wsp_open,
.f_close = &wsp_close,
.f_ioctl = &wsp_ioctl,
.f_start_read = &wsp_fifo_start_read,
.f_stop_read = &wsp_fifo_stop_read,
.basename[0] = WSP_DRIVER_NAME,
}
static usb_fifo_close_t wsp_close
Definition: wsp.c:611
static usb_fifo_ioctl_t wsp_ioctl
Definition: wsp.c:612
static usb_fifo_open_t wsp_open
Definition: wsp.c:610
static usb_fifo_cmd_t wsp_fifo_stop_read
Definition: wsp.c:609
static usb_fifo_cmd_t wsp_fifo_start_read
Definition: wsp.c:608

Definition at line 614 of file wsp.c.

Referenced by wsp_attach().

◆ wsp_fifo_start_read

usb_fifo_cmd_t wsp_fifo_start_read
static

Definition at line 608 of file wsp.c.

◆ wsp_fifo_stop_read

usb_fifo_cmd_t wsp_fifo_stop_read
static

Definition at line 609 of file wsp.c.

◆ wsp_intr_callback

usb_callback_t wsp_intr_callback
static

Definition at line 644 of file wsp.c.

◆ wsp_ioctl

usb_fifo_ioctl_t wsp_ioctl
static

Definition at line 612 of file wsp.c.

◆ wsp_methods

device_method_t wsp_methods[]
static
Initial value:
= {
DEVMETHOD(device_probe, wsp_probe),
DEVMETHOD(device_attach, wsp_attach),
DEVMETHOD(device_detach, wsp_detach),
DEVMETHOD_END
}
static device_probe_t wsp_probe
Definition: wsp.c:641
static device_attach_t wsp_attach
Definition: wsp.c:642
static device_detach_t wsp_detach
Definition: wsp.c:643

Definition at line 1558 of file wsp.c.

◆ wsp_open

usb_fifo_open_t wsp_open
static

Definition at line 610 of file wsp.c.

◆ wsp_probe

device_probe_t wsp_probe
static

Definition at line 641 of file wsp.c.

◆ wsp_tp

◆ wsp_tuning

struct wsp_tuning wsp_tuning
static
Initial value:
=
{
.scale_factor = 12,
.z_factor = 5,
.z_invert = 0,
.pressure_touch_threshold = 50,
.pressure_untouch_threshold = 10,
.pressure_tap_threshold = 120,
.scr_hor_threshold = 20,
.enable_single_tap_clicks = 1,
}

Referenced by wsp_intr_callback().