alpm.c (48528) | alpm.c (49195) |
---|---|
1/*- 2 * Copyright (c) 1998, 1999 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * | 1/*- 2 * Copyright (c) 1998, 1999 Nicolas Souchu 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 9 unchanged lines hidden (view full) --- 18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 * |
26 * $Id: alpm.c,v 1.4 1999/05/09 17:06:38 peter Exp $ | 26 * $Id: alpm.c,v 1.5 1999/07/03 20:17:00 peter Exp $ |
27 * 28 */ 29 30/* 31 * Power Management support for the Acer M15x3 chipsets 32 */ 33#include <sys/param.h> 34#include <sys/kernel.h> --- 107 unchanged lines hidden (view full) --- 142 143#define ALPM_SMBINB(alsmb,register) \ 144 (bus_space_read_1(alsmb->alpm->smbst, alsmb->alpm->smbsh, register)) 145#define ALPM_SMBOUTB(alsmb,register,value) \ 146 (bus_space_write_1(alsmb->alpm->smbst, alsmb->alpm->smbsh, register, value)) 147 148static int alsmb_probe(device_t); 149static int alsmb_attach(device_t); | 27 * 28 */ 29 30/* 31 * Power Management support for the Acer M15x3 chipsets 32 */ 33#include <sys/param.h> 34#include <sys/kernel.h> --- 107 unchanged lines hidden (view full) --- 142 143#define ALPM_SMBINB(alsmb,register) \ 144 (bus_space_read_1(alsmb->alpm->smbst, alsmb->alpm->smbsh, register)) 145#define ALPM_SMBOUTB(alsmb,register,value) \ 146 (bus_space_write_1(alsmb->alpm->smbst, alsmb->alpm->smbsh, register, value)) 147 148static int alsmb_probe(device_t); 149static int alsmb_attach(device_t); |
150static void alsmb_print_child(device_t, device_t); | |
151static int alsmb_smb_callback(device_t, int, caddr_t *); 152static int alsmb_smb_quick(device_t dev, u_char slave, int how); 153static int alsmb_smb_sendb(device_t dev, u_char slave, char byte); 154static int alsmb_smb_recvb(device_t dev, u_char slave, char *byte); 155static int alsmb_smb_writeb(device_t dev, u_char slave, char cmd, char byte); 156static int alsmb_smb_readb(device_t dev, u_char slave, char cmd, char *byte); 157static int alsmb_smb_writew(device_t dev, u_char slave, char cmd, short word); 158static int alsmb_smb_readw(device_t dev, u_char slave, char cmd, short *word); 159static int alsmb_smb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf); 160static int alsmb_smb_bread(device_t dev, u_char slave, char cmd, u_char count, char *byte); 161 162static devclass_t alsmb_devclass; 163 164static device_method_t alsmb_methods[] = { 165 /* device interface */ 166 DEVMETHOD(device_probe, alsmb_probe), 167 DEVMETHOD(device_attach, alsmb_attach), 168 169 /* bus interface */ | 150static int alsmb_smb_callback(device_t, int, caddr_t *); 151static int alsmb_smb_quick(device_t dev, u_char slave, int how); 152static int alsmb_smb_sendb(device_t dev, u_char slave, char byte); 153static int alsmb_smb_recvb(device_t dev, u_char slave, char *byte); 154static int alsmb_smb_writeb(device_t dev, u_char slave, char cmd, char byte); 155static int alsmb_smb_readb(device_t dev, u_char slave, char cmd, char *byte); 156static int alsmb_smb_writew(device_t dev, u_char slave, char cmd, short word); 157static int alsmb_smb_readw(device_t dev, u_char slave, char cmd, short *word); 158static int alsmb_smb_bwrite(device_t dev, u_char slave, char cmd, u_char count, char *buf); 159static int alsmb_smb_bread(device_t dev, u_char slave, char cmd, u_char count, char *byte); 160 161static devclass_t alsmb_devclass; 162 163static device_method_t alsmb_methods[] = { 164 /* device interface */ 165 DEVMETHOD(device_probe, alsmb_probe), 166 DEVMETHOD(device_attach, alsmb_attach), 167 168 /* bus interface */ |
170 DEVMETHOD(bus_print_child, alsmb_print_child), | 169 DEVMETHOD(bus_print_child, bus_generic_print_child), |
171 172 /* smbus interface */ 173 DEVMETHOD(smbus_callback, alsmb_smb_callback), 174 DEVMETHOD(smbus_quick, alsmb_smb_quick), 175 DEVMETHOD(smbus_sendb, alsmb_smb_sendb), 176 DEVMETHOD(smbus_recvb, alsmb_smb_recvb), 177 DEVMETHOD(smbus_writeb, alsmb_smb_writeb), 178 DEVMETHOD(smbus_readb, alsmb_smb_readb), --- 133 unchanged lines hidden (view full) --- 312 sc->smbus = smbus_alloc_bus(dev); 313 314 /* probe and attach the smbus */ 315 device_probe_and_attach(sc->smbus); 316 317 return (0); 318} 319 | 170 171 /* smbus interface */ 172 DEVMETHOD(smbus_callback, alsmb_smb_callback), 173 DEVMETHOD(smbus_quick, alsmb_smb_quick), 174 DEVMETHOD(smbus_sendb, alsmb_smb_sendb), 175 DEVMETHOD(smbus_recvb, alsmb_smb_recvb), 176 DEVMETHOD(smbus_writeb, alsmb_smb_writeb), 177 DEVMETHOD(smbus_readb, alsmb_smb_readb), --- 133 unchanged lines hidden (view full) --- 311 sc->smbus = smbus_alloc_bus(dev); 312 313 /* probe and attach the smbus */ 314 device_probe_and_attach(sc->smbus); 315 316 return (0); 317} 318 |
320static void 321alsmb_print_child(device_t bus, device_t dev) 322{ 323 printf(" on %s%d", device_get_name(bus), device_get_unit(bus)); 324 325 return; 326} 327 | |
328static int 329alsmb_smb_callback(device_t dev, int index, caddr_t *data) 330{ 331 int error = 0; 332 333 switch (index) { 334 case SMB_REQUEST_BUS: 335 case SMB_RELEASE_BUS: --- 340 unchanged lines hidden --- | 319static int 320alsmb_smb_callback(device_t dev, int index, caddr_t *data) 321{ 322 int error = 0; 323 324 switch (index) { 325 case SMB_REQUEST_BUS: 326 case SMB_RELEASE_BUS: --- 340 unchanged lines hidden --- |