type
stringclasses
5 values
content
stringlengths
9
163k
defines
#define GAIN_MAX 255
defines
#define EXPO12A_DEF 3
defines
#define Rev012A 0
defines
#define Rev072A 1
defines
#define AG_CNT_START 13
defines
#define SPCA561_OFFSET_SNAP 1
defines
#define SPCA561_OFFSET_TYPE 2
defines
#define SPCA561_OFFSET_COMPRESS 3
defines
#define SPCA561_OFFSET_FRAMSEQ 4
defines
#define SPCA561_OFFSET_GPIO 5
defines
#define SPCA561_OFFSET_USBBUFF 6
defines
#define SPCA561_OFFSET_WIN2GRAVE 7
defines
#define SPCA561_OFFSET_WIN2RAVE 8
defines
#define SPCA561_OFFSET_WIN2BAVE 9
defines
#define SPCA561_OFFSET_WIN2GBAVE 10
defines
#define SPCA561_OFFSET_WIN1GRAVE 11
defines
#define SPCA561_OFFSET_WIN1RAVE 12
defines
#define SPCA561_OFFSET_WIN1BAVE 13
defines
#define SPCA561_OFFSET_WIN1GBAVE 14
defines
#define SPCA561_OFFSET_FREQ 15
defines
#define SPCA561_OFFSET_VSYNC 16
defines
#define SPCA561_INDEX_I2C_BASE 0x8800
defines
#define SPCA561_SNAPBIT 0x20
defines
#define SPCA561_SNAPCTRL 0x40
structs
struct sd { struct gspca_dev gspca_dev; /* !! must be the first item */ __u16 exposure; /* rev12a only */ #define EXPOSURE_MIN 1 #define EXPOSURE_DEF 700 /* == 10 fps */ #define EXPOSURE_MAX (2047 + 325) /* see setexposure */ __u8 contrast; /* rev72a only */ #define CONTRAST_MIN 0x00 #define CONTRAST_DEF 0x20...
functions
void reg_w_val(struct usb_device *dev, __u16 index, __u8 value) { int ret; ret = usb_control_msg(dev, usb_sndctrlpipe(dev, 0), 0, /* request */ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, value, index, NULL, 0, 500); PDEBUG(D_USBO, "reg write: 0x%02x:0x%02x", index, value); if (re...
functions
void write_vector(struct gspca_dev *gspca_dev, const __u16 data[][2]) { struct usb_device *dev = gspca_dev->dev; int i; i = 0; while (data[i][1] != 0) { reg_w_val(dev, data[i][1], data[i][0]); i++; }
functions
void reg_r(struct gspca_dev *gspca_dev, __u16 index, __u16 length) { usb_control_msg(gspca_dev->dev, usb_rcvctrlpipe(gspca_dev->dev, 0), 0, /* request */ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0, /* value */ index, gspca_dev->usb_buf, length, 500); }
functions
void reg_w_buf(struct gspca_dev *gspca_dev, __u16 index, __u16 len) { usb_control_msg(gspca_dev->dev, usb_sndctrlpipe(gspca_dev->dev, 0), 0, /* request */ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, 0, /* value */ index, gspca_dev->usb_buf, len, 500); }
functions
void i2c_write(struct gspca_dev *gspca_dev, __u16 value, __u16 reg) { int retry = 60; reg_w_val(gspca_dev->dev, 0x8801, reg); reg_w_val(gspca_dev->dev, 0x8805, value); reg_w_val(gspca_dev->dev, 0x8800, value >> 8); do { reg_r(gspca_dev, 0x8803, 1); if (!gspca_dev->usb_buf[0]) return; msleep(10); }
functions
int i2c_read(struct gspca_dev *gspca_dev, __u16 reg, __u8 mode) { int retry = 60; __u8 value; reg_w_val(gspca_dev->dev, 0x8804, 0x92); reg_w_val(gspca_dev->dev, 0x8801, reg); reg_w_val(gspca_dev->dev, 0x8802, mode | 0x01); do { reg_r(gspca_dev, 0x8803, 1); if (!gspca_dev->usb_buf[0]) { reg_r(gspca_dev, 0x...
functions
void init_161rev12A(struct gspca_dev *gspca_dev) { write_vector(gspca_dev, spca561_161rev12A_data1); sensor_mapwrite(gspca_dev, Pb100_1map8300); /*fixme: should be in sd_start*/ write_vector(gspca_dev, spca561_161rev12A_data2); sensor_mapwrite(gspca_dev, Pb100_2map8300); }
functions
int sd_config(struct gspca_dev *gspca_dev, const struct usb_device_id *id) { struct sd *sd = (struct sd *) gspca_dev; struct cam *cam; __u16 vendor, product; __u8 data1, data2; /* Read frm global register the USB product and vendor IDs, just to * prove that we can communicate with the device. This works...
functions
int sd_init_12a(struct gspca_dev *gspca_dev) { PDEBUG(D_STREAM, "Chip revision: 012a"); init_161rev12A(gspca_dev); return 0; }
functions
int sd_init_72a(struct gspca_dev *gspca_dev) { PDEBUG(D_STREAM, "Chip revision: 072a"); write_vector(gspca_dev, rev72a_reset); msleep(200); write_vector(gspca_dev, rev72a_init_data1); write_sensor_72a(gspca_dev, rev72a_init_sensor1); write_vector(gspca_dev, rev72a_init_data2); write_sensor_72a(gspca_dev, rev72a_...
functions
void setbrightness(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; struct usb_device *dev = gspca_dev->dev; __u8 value; value = sd->brightness; /* offsets for white balance */ reg_w_val(dev, 0x8611, value); /* R */ reg_w_val(dev, 0x8612, value); /* Gr */ reg_w_val(dev, 0x8613, value)...
functions
void setwhite(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; __u16 white; __u8 blue, red; __u16 reg; /* try to emulate MS-win as possible */ white = sd->white; red = 0x20 + white * 3 / 8; blue = 0x90 - white * 5 / 8; if (sd->chip_revision == Rev012A) { reg = 0x8614; }
functions
void setcontrast(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; struct usb_device *dev = gspca_dev->dev; __u8 value; if (sd->chip_revision != Rev072A) return; value = sd->contrast + 0x20; /* gains for white balance */ setwhite(gspca_dev); /* reg_w_val(dev, 0x8651, value); * R - don...
functions
void setexposure(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; int i, expo = 0; /* Register 0x8309 controls exposure for the spca561, the basic exposure setting goes from 1-2047, where 1 is completely dark and 2047 is very bright. It not only influences exposure but also the fr...
functions
void setgain(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; /* gain reg low 6 bits 0-63 gain, bit 6 and 7, both double the sensitivity when set, so 31 + one of them set == 63, and 15 with both of them set == 63 */ if (sd->gain < 64) gspca_dev->usb_buf[0] = sd->gain; else if (sd-...
functions
void setautogain(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; if (sd->autogain) sd->ag_cnt = AG_CNT_START; else sd->ag_cnt = -1; }
functions
int sd_start_12a(struct gspca_dev *gspca_dev) { struct usb_device *dev = gspca_dev->dev; int mode; static const __u8 Reg8391[8] = {0x92, 0x30, 0x20, 0x00, 0x0c, 0x00, 0x00, 0x00}
functions
int sd_start_72a(struct gspca_dev *gspca_dev) { struct usb_device *dev = gspca_dev->dev; int Clck; int mode; write_vector(gspca_dev, rev72a_reset); msleep(200); write_vector(gspca_dev, rev72a_init_data1); write_sensor_72a(gspca_dev, rev72a_init_sensor1); mode = gspca_dev->cam.cam_mode[(int) gspca_dev->curr_mo...
functions
void sd_stopN(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; if (sd->chip_revision == Rev012A) { reg_w_val(gspca_dev->dev, 0x8112, 0x0e); }
functions
void sd_stop0(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; if (!gspca_dev->present) return; if (sd->chip_revision == Rev012A) { reg_w_val(gspca_dev->dev, 0x8118, 0x29); reg_w_val(gspca_dev->dev, 0x8114, 0x08); }
functions
void do_autogain(struct gspca_dev *gspca_dev) { struct sd *sd = (struct sd *) gspca_dev; int expotimes; int pixelclk; int gainG; __u8 R, Gr, Gb, B; int y; __u8 luma_mean = 110; __u8 luma_delta = 20; __u8 spring = 4; if (sd->ag_cnt < 0) return; if (--sd->ag_cnt >= 0) return; sd->ag_cnt = AG_CNT_START; ...
functions
int sd_setbrightness(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->brightness = val; if (gspca_dev->streaming) setbrightness(gspca_dev); return 0; }
functions
int sd_getbrightness(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->brightness; return 0; }
functions
int sd_setcontrast(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->contrast = val; if (gspca_dev->streaming) setcontrast(gspca_dev); return 0; }
functions
int sd_getcontrast(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->contrast; return 0; }
functions
int sd_setautogain(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->autogain = val; if (gspca_dev->streaming) setautogain(gspca_dev); return 0; }
functions
int sd_getautogain(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->autogain; return 0; }
functions
int sd_setwhite(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->white = val; if (gspca_dev->streaming) setwhite(gspca_dev); return 0; }
functions
int sd_getwhite(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->white; return 0; }
functions
int sd_setexposure(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->exposure = val; if (gspca_dev->streaming) setexposure(gspca_dev); return 0; }
functions
int sd_getexposure(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->exposure; return 0; }
functions
int sd_setgain(struct gspca_dev *gspca_dev, __s32 val) { struct sd *sd = (struct sd *) gspca_dev; sd->gain = val; if (gspca_dev->streaming) setgain(gspca_dev); return 0; }
functions
int sd_getgain(struct gspca_dev *gspca_dev, __s32 *val) { struct sd *sd = (struct sd *) gspca_dev; *val = sd->gain; return 0; }
functions
int sd_probe(struct usb_interface *intf, const struct usb_device_id *id) { return gspca_dev_probe(intf, id, sd_desc[id->driver_info], sizeof(struct sd), THIS_MODULE); }
functions
__init sd_mod_init(void) { int ret; ret = usb_register(&sd_driver); if (ret < 0) return ret; PDEBUG(D_PROBE, "registered"); return 0; }
functions
__exit sd_mod_exit(void) { usb_deregister(&sd_driver); PDEBUG(D_PROBE, "deregistered"); }
includes
#include <linux/completion.h>
includes
#include <net/sock.h>
includes
#include <linux/lnet/lib-lnet.h>
defines
#define DEBUG_SUBSYSTEM S_LNET
functions
int lnet_acceptor_port(void) { return accept_port; }
functions
int lnet_accept_magic(__u32 magic, __u32 constant) { return (magic == constant || magic == __swab32(constant)); }
functions
int lnet_acceptor_get_tunables(void) { /* * Userland acceptor uses 'accept_type' instead of 'accept', due to * conflict with 'accept(2)', but kernel acceptor still uses 'accept' * for compatibility. Hence the trick. */ accept_type = accept; return 0; }
functions
int lnet_acceptor_timeout(void) { return accept_timeout; }
functions
void lnet_connect_console_error(int rc, lnet_nid_t peer_nid, __u32 peer_ip, int peer_port) { switch (rc) { /* "normal" errors */ case -ECONNREFUSED: CNETERR("Connection to %s at host %pI4h on port %d was refused: check that Lustre is running on that node.\n", libcfs_nid2str(peer_nid), &peer_ip, peer_po...
functions
int lnet_connect(struct socket **sockp, lnet_nid_t peer_nid, __u32 local_ip, __u32 peer_ip, int peer_port) { struct lnet_acceptor_connreq cr; struct socket *sock; int rc; int port; int fatal; BUILD_BUG_ON(sizeof(cr) > 16); /* too big to be on the stack */ for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT; ...
functions
int lnet_accept(struct socket *sock, __u32 magic) { struct lnet_acceptor_connreq cr; __u32 peer_ip; int peer_port; int rc; int flip; struct lnet_ni *ni; char *str; LASSERT(sizeof(cr) <= 16); /* not too big for the stack */ rc = lnet_sock_getaddr(sock, 1, &peer_ip, &peer_port); LASSERT(!rc); /* w...
functions
int lnet_acceptor(void *arg) { struct socket *newsock; int rc; __u32 magic; __u32 peer_ip; int peer_port; int secure = (int)((long)arg); LASSERT(!lnet_acceptor_state.pta_sock); cfs_block_allsigs(); rc = lnet_sock_listen(&lnet_acceptor_state.pta_sock, 0, accept_port, accept_backlog); if (rc) { if...
functions
int accept2secure(const char *acc, long *sec) { if (!strcmp(acc, "secure")) { *sec = 1; return 1; }
functions
int lnet_acceptor_start(void) { struct task_struct *task; int rc; long rc2; long secure; /* if acceptor is already running return immediately */ if (!lnet_acceptor_state.pta_shutdown) return 0; LASSERT(!lnet_acceptor_state.pta_sock); rc = lnet_acceptor_get_tunables(); if (rc) return rc; init_completio...
functions
void lnet_acceptor_stop(void) { struct sock *sk; if (lnet_acceptor_state.pta_shutdown) /* not running */ return; lnet_acceptor_state.pta_shutdown = 1; sk = lnet_acceptor_state.pta_sock->sk; /* awake any sleepers using safe method */ sk->sk_state_change(sk); /* block until acceptor signals exit */ wait_fo...
functions
uint64_t ud_syn_rel_target(struct ud *u, struct ud_operand *opr) { uint64_t trunc_mask = 0xffffffffffffffffull; if (u->dis_mode <32) trunc_mask >>= (64 - u->opr_mode); switch (opr->size) { case 8 : return (u->pc + opr->lval.sbyte) & trunc_mask; case 16: { int delta = (opr->lval.sword & trunc_mask); if ((u-...
functions
int ud_asmprintf(struct ud *u, const char *fmt, ...) { int ret; int avail; va_list ap; va_start(ap, fmt); avail = u->asm_buf_size - u->asm_buf_fill - 1 /* nullchar */; ret = vsnprintf((char*) u->asm_buf + u->asm_buf_fill, avail, fmt, ap); if (ret < 0 || ret > avail) { u->asm_buf_fill = u->asm_buf_si...
functions
void ud_syn_print_addr(struct ud *u, uint64_t addr) { const char *name = NULL; if (u->sym_resolver) { int64_t offset = 0; name = u->sym_resolver(u, addr, &offset); if (name) { if (offset) { ud_asmprintf(u, "%s%+" FMT64 "d", name, offset); }
functions
void ud_syn_print_imm(struct ud* u, const struct ud_operand *op) { uint64_t v; if (op->_oprcode == OP_sI && op->size != u->opr_mode) { if (op->size == 8) { v = (int64_t)op->lval.sbyte; }
functions
void ud_syn_print_mem_disp(struct ud* u, const struct ud_operand *op, int sign) { UD_ASSERT(op->offset != 0); if (op->base == UD_NONE && op->index == UD_NONE) { uint64_t v; UD_ASSERT(op->scale == UD_NONE && op->offset != 8); /* unsigned mem-offset */ switch (op->offset) { case 16: v = op->lval.uw...
functions
else if (v > 0) { ud_asmprintf(u, "%s0x%" FMT64 "x", sign? "+" : "", v); }
includes
#include <linux/gpio.h>
includes
#include <linux/init.h>
includes
#include <linux/platform_device.h>
includes
#include <linux/serial_8250.h>
includes
#include <linux/smsc911x.h>
includes
#include <linux/types.h>
includes
#include <linux/regulator/machine.h>
includes
#include <linux/regulator/fixed.h>
includes
#include <asm/irq.h>
includes
#include <asm/mach-types.h>
includes
#include <asm/memory.h>
includes
#include <asm/setup.h>
includes
#include <asm/mach/arch.h>
includes
#include <asm/mach/irq.h>
includes
#include <asm/mach/map.h>
includes
#include <asm/mach/time.h>
includes
#include <mach/common.h>
includes
#include <mach/hardware.h>