add support for controlling power to the modem in some PowerBooks
works at least with my Pismo, probably others
This commit is contained in:
parent
4c73f7f041
commit
d4e53faa15
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: pmu.c,v 1.18 2010/09/14 04:40:35 macallan Exp $ */
|
||||
/* $NetBSD: pmu.c,v 1.19 2010/11/09 20:44:49 macallan Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2006 Michael Lorenz
|
||||
@ -27,7 +27,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.18 2010/09/14 04:40:35 macallan Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmu.c,v 1.19 2010/11/09 20:44:49 macallan Exp $");
|
||||
|
||||
#include <sys/param.h>
|
||||
#include <sys/systm.h>
|
||||
@ -758,6 +758,20 @@ pmu_restart(void)
|
||||
while (1);
|
||||
}
|
||||
|
||||
void
|
||||
pmu_modem(int on)
|
||||
{
|
||||
struct pmu_softc *sc;
|
||||
uint8_t resp[16], cmd[2] = {0, 0};
|
||||
|
||||
if (pmu0 == NULL)
|
||||
return;
|
||||
|
||||
sc = pmu0;
|
||||
cmd[0] = PMU_POW0_MODEM | (on ? PMU_POW0_ON : 0);
|
||||
pmu_send(sc, PMU_POWER_CTRL0, 1, cmd, 16, resp);
|
||||
}
|
||||
|
||||
static void
|
||||
pmu_autopoll(void *cookie, int flag)
|
||||
{
|
||||
|
@ -25,7 +25,7 @@
|
||||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmuvar.h,v 1.7 2008/04/29 06:53:02 martin Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: pmuvar.h,v 1.8 2010/11/09 20:44:49 macallan Exp $");
|
||||
|
||||
#ifndef PMUVAR_H
|
||||
#define PMUVAR_H
|
||||
@ -72,6 +72,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmuvar.h,v 1.7 2008/04/29 06:53:02 martin Exp $");
|
||||
#define PMU_I2C_CMD 0x9a /* i2c commands */
|
||||
#define PMU_GET_LID_STATE 0xdc /* Report lid state */
|
||||
#define PMU_GET_VERSION 0xea /* Identify thyself */
|
||||
#define PMU_SET_LED 0xee /* control system LED */
|
||||
|
||||
/* Bits in PMU interrupt and interrupt mask bytes */
|
||||
#define PMU_INT_ADB_AUTO 0x04 /* ADB autopoll, when PMU_INT_ADB */
|
||||
@ -86,6 +87,7 @@ __KERNEL_RCSID(0, "$NetBSD: pmuvar.h,v 1.7 2008/04/29 06:53:02 martin Exp $");
|
||||
#define PMU_POW0_ON 0x80 /* OR this to power ON the device */
|
||||
#define PMU_POW0_OFF 0x00 /* leave bit 7 to 0 to power it OFF */
|
||||
#define PMU_POW0_HARD_DRIVE 0x04 /* wallstreet/lombard? */
|
||||
#define PMU_POW0_MODEM 0x08 /* pismo, maybe others */
|
||||
|
||||
/* Bits to use with the PMU_POWER_CTRL command */
|
||||
#define PMU_POW_ON 0x80 /* OR this to power ON the device */
|
||||
@ -148,5 +150,6 @@ struct pmu_ops {
|
||||
|
||||
void pmu_poweroff(void);
|
||||
void pmu_restart(void);
|
||||
void pmu_modem(int);
|
||||
|
||||
#endif /* PMUVAR_H */
|
||||
|
Loading…
Reference in New Issue
Block a user