Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Enumerations | Functions | Variables
via-pmu68k.c File Reference
#include <stdarg.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/miscdevice.h>
#include <linux/blkdev.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/adb.h>
#include <linux/pmu.h>
#include <linux/cuda.h>
#include <asm/macintosh.h>
#include <asm/macints.h>
#include <asm/mac_via.h>
#include <asm/pgtable.h>
#include <asm/irq.h>
#include <asm/uaccess.h>

Go to the source code of this file.

Macros

#define PMU_MINOR   154
 
#define RS   0x200 /* skip between registers */
 
#define B   0 /* B-side data */
 
#define A   RS /* A-side data */
 
#define DIRB   (2*RS) /* B-side direction (1=output) */
 
#define DIRA   (3*RS) /* A-side direction (1=output) */
 
#define T1CL   (4*RS) /* Timer 1 ctr/latch (low 8 bits) */
 
#define T1CH   (5*RS) /* Timer 1 counter (high 8 bits) */
 
#define T1LL   (6*RS) /* Timer 1 latch (low 8 bits) */
 
#define T1LH   (7*RS) /* Timer 1 latch (high 8 bits) */
 
#define T2CL   (8*RS) /* Timer 2 ctr/latch (low 8 bits) */
 
#define T2CH   (9*RS) /* Timer 2 counter (high 8 bits) */
 
#define SR   (10*RS) /* Shift register */
 
#define ACR   (11*RS) /* Auxiliary control register */
 
#define PCR   (12*RS) /* Peripheral control register */
 
#define IFR   (13*RS) /* Interrupt flag register */
 
#define IER   (14*RS) /* Interrupt enable register */
 
#define ANH   (15*RS) /* A-side data, no handshake */
 
#define TACK   0x02 /* Transfer acknowledge (input) */
 
#define TREQ   0x04 /* Transfer request (output) */
 
#define SR_CTRL   0x1c /* Shift register control bits */
 
#define SR_EXT   0x0c /* Shift on external clock */
 
#define SR_OUT   0x10 /* Shift out if 1 */
 
#define SR_INT   0x04 /* Shift register full/empty */
 
#define CB1_INT   0x10 /* transition on CB1 input */
 
#define LEVEL_TO_BRIGHT(lev)   ((lev) < 1? 0x7f: 0x4a - ((lev) << 1))
 

Enumerations

enum  pmu_state {
  idle, sending, intack, reading,
  reading_intr, locked, idle, sending,
  intack, reading, reading_intr
}
 

Functions

void pmu_poll (void)
 
int pmu_get_model (void)
 
int pmu_request (struct adb_request *req, void(*done)(struct adb_request *), int nbytes,...)
 
int pmu_queue_request (struct adb_request *req)
 
void pmu_enable_irled (int on)
 
int pmu_present (void)
 

Variables

int asleep
 
struct adb_driver via_pmu_driver
 

Macro Definition Documentation

#define A   RS /* A-side data */

Definition at line 49 of file via-pmu68k.c.

#define ACR   (11*RS) /* Auxiliary control register */

Definition at line 59 of file via-pmu68k.c.

#define ANH   (15*RS) /* A-side data, no handshake */

Definition at line 63 of file via-pmu68k.c.

#define B   0 /* B-side data */

Definition at line 48 of file via-pmu68k.c.

#define CB1_INT   0x10 /* transition on CB1 input */

Definition at line 76 of file via-pmu68k.c.

#define DIRA   (3*RS) /* A-side direction (1=output) */

Definition at line 51 of file via-pmu68k.c.

#define DIRB   (2*RS) /* B-side direction (1=output) */

Definition at line 50 of file via-pmu68k.c.

#define IER   (14*RS) /* Interrupt enable register */

Definition at line 62 of file via-pmu68k.c.

#define IFR   (13*RS) /* Interrupt flag register */

Definition at line 61 of file via-pmu68k.c.

#define LEVEL_TO_BRIGHT (   lev)    ((lev) < 1? 0x7f: 0x4a - ((lev) << 1))

Definition at line 743 of file via-pmu68k.c.

#define PCR   (12*RS) /* Peripheral control register */

Definition at line 60 of file via-pmu68k.c.

#define PMU_MINOR   154

Definition at line 44 of file via-pmu68k.c.

#define RS   0x200 /* skip between registers */

Definition at line 47 of file via-pmu68k.c.

#define SR   (10*RS) /* Shift register */

Definition at line 58 of file via-pmu68k.c.

#define SR_CTRL   0x1c /* Shift register control bits */

Definition at line 70 of file via-pmu68k.c.

#define SR_EXT   0x0c /* Shift on external clock */

Definition at line 71 of file via-pmu68k.c.

#define SR_INT   0x04 /* Shift register full/empty */

Definition at line 75 of file via-pmu68k.c.

#define SR_OUT   0x10 /* Shift out if 1 */

Definition at line 72 of file via-pmu68k.c.

#define T1CH   (5*RS) /* Timer 1 counter (high 8 bits) */

Definition at line 53 of file via-pmu68k.c.

#define T1CL   (4*RS) /* Timer 1 ctr/latch (low 8 bits) */

Definition at line 52 of file via-pmu68k.c.

#define T1LH   (7*RS) /* Timer 1 latch (high 8 bits) */

Definition at line 55 of file via-pmu68k.c.

#define T1LL   (6*RS) /* Timer 1 latch (low 8 bits) */

Definition at line 54 of file via-pmu68k.c.

#define T2CH   (9*RS) /* Timer 2 counter (high 8 bits) */

Definition at line 57 of file via-pmu68k.c.

#define T2CL   (8*RS) /* Timer 2 ctr/latch (low 8 bits) */

Definition at line 56 of file via-pmu68k.c.

#define TACK   0x02 /* Transfer acknowledge (input) */

Definition at line 66 of file via-pmu68k.c.

#define TREQ   0x04 /* Transfer request (output) */

Definition at line 67 of file via-pmu68k.c.

Enumeration Type Documentation

enum pmu_state
Enumerator:
idle 
sending 
intack 
reading 
reading_intr 
locked 
idle 
sending 
intack 
reading 
reading_intr 

Definition at line 78 of file via-pmu68k.c.

Function Documentation

void pmu_enable_irled ( int  on)

Definition at line 797 of file via-pmu68k.c.

int pmu_get_model ( void  )

Definition at line 265 of file via-pmu68k.c.

void pmu_poll ( void  )

Definition at line 1239 of file via-pmu.c.

int pmu_present ( void  )

Definition at line 813 of file via-pmu68k.c.

int pmu_queue_request ( struct adb_request req)

Definition at line 474 of file via-pmu68k.c.

int pmu_request ( struct adb_request req,
void(*)(struct adb_request *)  done,
int  nbytes,
  ... 
)

Definition at line 447 of file via-pmu68k.c.

Variable Documentation

int asleep

Definition at line 100 of file via-pmu68k.c.

struct adb_driver via_pmu_driver
Initial value:
= {
"68K PMU",
pmu_probe,
pmu_init,
pmu_send_request,
pmu_autopoll,
pmu_reset_bus
}

Definition at line 120 of file via-pmu68k.c.