Creation of Cybook 2416 (actually Gen4) repository
This commit is contained in:
39
include/linux/l3/algo-bit.h
Normal file
39
include/linux/l3/algo-bit.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* linux/include/linux/l3/algo-bit.h
|
||||
*
|
||||
* Copyright (C) 2001 Russell King, All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License.
|
||||
*
|
||||
* L3 Bus bit-banging algorithm. Derived from i2c-algo-bit.h by
|
||||
* Simon G. Vogl.
|
||||
*/
|
||||
#ifndef L3_ALGO_BIT_H
|
||||
#define L3_ALGO_BIT_H 1
|
||||
|
||||
#include <linux/l3/l3.h>
|
||||
|
||||
struct l3_algo_bit_data {
|
||||
void (*setdat) (void *data, int state);
|
||||
void (*setclk) (void *data, int state);
|
||||
void (*setmode)(void *data, int state);
|
||||
void (*setdir) (void *data, int in); /* set data direction */
|
||||
int (*getdat) (void *data);
|
||||
|
||||
void *data;
|
||||
|
||||
/* bus timings (us) */
|
||||
int data_hold;
|
||||
int data_setup;
|
||||
int clock_high;
|
||||
int mode_hold;
|
||||
int mode_setup;
|
||||
int mode;
|
||||
};
|
||||
|
||||
int l3_bit_add_bus(struct l3_adapter *);
|
||||
int l3_bit_del_bus(struct l3_adapter *);
|
||||
|
||||
#endif
|
||||
95
include/linux/l3/l3.h
Normal file
95
include/linux/l3/l3.h
Normal file
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* linux/include/linux/l3/l3.h
|
||||
*
|
||||
* Copyright (C) 2001 Russell King, All Rights Reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License.
|
||||
*
|
||||
* Derived from i2c.h by Simon G. Vogl
|
||||
*/
|
||||
#ifndef L3_H
|
||||
#define L3_H
|
||||
|
||||
struct l3_msg {
|
||||
unsigned char addr; /* slave address */
|
||||
unsigned char flags;
|
||||
#define L3_M_RD 0x01
|
||||
#define L3_M_NOADDR 0x02
|
||||
unsigned short len; /* msg length */
|
||||
unsigned char *buf; /* pointer to msg data */
|
||||
};
|
||||
|
||||
#ifdef __KERNEL__
|
||||
|
||||
#include <linux/types.h>
|
||||
#include <linux/list.h>
|
||||
|
||||
struct l3_adapter;
|
||||
|
||||
struct l3_algorithm {
|
||||
/* textual description */
|
||||
char name[32];
|
||||
|
||||
/* perform bus transactions */
|
||||
int (*xfer)(struct l3_adapter *, struct l3_msg msgs[], int num);
|
||||
};
|
||||
|
||||
struct semaphore;
|
||||
|
||||
/*
|
||||
* l3_adapter is the structure used to identify a physical L3 bus along
|
||||
* with the access algorithms necessary to access it.
|
||||
*/
|
||||
struct l3_adapter {
|
||||
/*
|
||||
* This name is used to uniquely identify the adapter.
|
||||
* It should be the same as the module name.
|
||||
*/
|
||||
char name[32];
|
||||
|
||||
/*
|
||||
* the algorithm to access the bus
|
||||
*/
|
||||
struct l3_algorithm *algo;
|
||||
|
||||
/*
|
||||
* Algorithm specific data
|
||||
*/
|
||||
void *algo_data;
|
||||
|
||||
/*
|
||||
* This may be NULL, or should point to the module struct
|
||||
*/
|
||||
struct module *owner;
|
||||
|
||||
/*
|
||||
* private data for the adapter
|
||||
*/
|
||||
void *data;
|
||||
|
||||
/*
|
||||
* Our lock. Unlike the i2c layer, we allow this to be used for
|
||||
* other stuff, like the i2c layer lock. Some people implement
|
||||
* i2c stuff using the same signals as the l3 bus.
|
||||
*/
|
||||
struct semaphore *lock;
|
||||
|
||||
/*
|
||||
* List of all adapters.
|
||||
*/
|
||||
struct list_head adapters;
|
||||
};
|
||||
|
||||
extern int l3_add_adapter(struct l3_adapter *);
|
||||
extern int l3_del_adapter(struct l3_adapter *);
|
||||
extern void l3_put_adapter(struct l3_adapter *);
|
||||
extern struct l3_adapter *l3_get_adapter(const char *name);
|
||||
|
||||
extern int l3_write(struct l3_adapter *, int, const char *, int);
|
||||
extern int l3_read(struct l3_adapter *, int, char *, int);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* L3_H */
|
||||
61
include/linux/l3/uda1341.h
Normal file
61
include/linux/l3/uda1341.h
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
* linux/include/linux/l3/uda1341.h
|
||||
*
|
||||
* Philips UDA1341 mixer device driver
|
||||
*
|
||||
* Copyright (c) 2000 Nicolas Pitre <nico@cam.org>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License.
|
||||
*/
|
||||
|
||||
#define UDA1341_NAME "uda1341"
|
||||
|
||||
struct uda1341_cfg {
|
||||
unsigned int fs:16;
|
||||
unsigned int format:3;
|
||||
};
|
||||
|
||||
#define FMT_I2S 0
|
||||
#define FMT_LSB16 1
|
||||
#define FMT_LSB18 2
|
||||
#define FMT_LSB20 3
|
||||
#define FMT_MSB 4
|
||||
#define FMT_LSB16MSB 5
|
||||
#define FMT_LSB18MSB 6
|
||||
#define FMT_LSB20MSB 7
|
||||
|
||||
#define L3_UDA1341_CONFIGURE 0x13410001
|
||||
|
||||
struct l3_gain {
|
||||
unsigned int left:8;
|
||||
unsigned int right:8;
|
||||
unsigned int unused:8;
|
||||
unsigned int channel:8;
|
||||
};
|
||||
|
||||
#define L3_SET_VOLUME 0x13410002
|
||||
#define L3_SET_TREBLE 0x13410003
|
||||
#define L3_SET_BASS 0x13410004
|
||||
#define L3_SET_GAIN 0x13410005
|
||||
|
||||
struct l3_agc {
|
||||
unsigned int level:8;
|
||||
unsigned int enable:1;
|
||||
unsigned int attack:7;
|
||||
unsigned int decay:8;
|
||||
unsigned int channel:8;
|
||||
};
|
||||
|
||||
#define L3_INPUT_AGC 0x13410006
|
||||
|
||||
struct uda1341;
|
||||
|
||||
int uda1341_configure(struct uda1341 *uda, struct uda1341_cfg *conf);
|
||||
int uda1341_mixer_ctl(struct uda1341 *uda, int cmd, void *arg);
|
||||
int uda1341_open(struct uda1341 *uda);
|
||||
void uda1341_close(struct uda1341 *uda);
|
||||
|
||||
struct uda1341 *uda1341_attach(const char *adapter);
|
||||
void uda1341_detach(struct uda1341 *uda);
|
||||
|
||||
Reference in New Issue
Block a user