Use adcvar.h.

This commit is contained in:
uwe 2003-10-22 23:52:46 +00:00
parent 22396ac6f7
commit 49fd54d39a
4 changed files with 50 additions and 15 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: j6x0pwr.c,v 1.2 2003/10/19 02:23:51 uwe Exp $ */
/* $NetBSD: j6x0pwr.c,v 1.3 2003/10/22 23:52:46 uwe Exp $ */
/*
* Copyright (c) 2003 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.2 2003/10/19 02:23:51 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.3 2003/10/22 23:52:46 uwe Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -40,12 +40,14 @@ __KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.2 2003/10/19 02:23:51 uwe Exp $");
#include <sys/gmon.h>
#endif
#include <machine/platid.h>
#include <machine/platid_mask.h>
#include <sh3/exception.h>
#include <sh3/intcreg.h>
#include <sh3/pfcreg.h>
#include <machine/platid.h>
#include <machine/platid_mask.h>
#include <sh3/dev/adcvar.h>
/* SH7709_PGDR bits pertinent to Jornada 6x0 power */
@ -61,8 +63,6 @@ __KERNEL_RCSID(0, "$NetBSD: j6x0pwr.c,v 1.2 2003/10/19 02:23:51 uwe Exp $");
#define J6X0PWR_BATTERY_WARNING_THRESHOLD 200
extern int adc_sample_channel(int); /* XXX: adcvar.h */
struct j6x0pwr_softc {
struct device sc_dev;
@ -163,7 +163,7 @@ j6x0pwr_poll_callout(void *self)
pgdr = _reg_read_1(SH7709_PGDR);
/* just check main battery charge it not verbose and battery is in */
/* just check main battery charge if not verbose and battery is in */
if (!j6x0pwr_poll_verbose) {
if (pgdr & PGDR_MAIN_BATTERY_OUT)
goto reschedule;

View File

@ -1,4 +1,4 @@
/* $NetBSD: j6x0tp.c,v 1.1 2003/10/19 02:20:25 uwe Exp $ */
/* $NetBSD: j6x0tp.c,v 1.2 2003/10/22 23:52:46 uwe Exp $ */
/*
* Copyright (c) 2003 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.1 2003/10/19 02:20:25 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.2 2003/10/22 23:52:46 uwe Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -54,6 +54,9 @@ __KERNEL_RCSID(0, "$NetBSD: j6x0tp.c,v 1.1 2003/10/19 02:20:25 uwe Exp $");
#include <sh3/pfcreg.h>
#include <sh3/adcreg.h>
#include <sh3/dev/adcvar.h>
#define J6X0TP_DEBUG
#if 0 /* XXX: disabled in favor of local version that uses printf_nolog */
#define DPRINTF_ENABLE
@ -83,8 +86,6 @@ volatile int j6x0tp_debug = 0;
#define ADC_CHANNEL_TP_Y 1
#define ADC_CHANNEL_TP_X 2
extern int adc_sample_channel(int); /* XXX: adcvar.h */
struct j6x0tp_softc {
struct device sc_dev;

View File

@ -1,4 +1,4 @@
/* $NetBSD: adc.c,v 1.2 2003/10/19 02:22:56 uwe Exp $ */
/* $NetBSD: adc.c,v 1.3 2003/10/22 23:52:46 uwe Exp $ */
/*
* Copyright (c) 2003 Valeriy E. Ushakov
@ -28,7 +28,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.2 2003/10/19 02:22:56 uwe Exp $");
__KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.3 2003/10/22 23:52:46 uwe Exp $");
#include <sys/param.h>
#include <sys/kernel.h>
@ -40,6 +40,7 @@ __KERNEL_RCSID(0, "$NetBSD: adc.c,v 1.2 2003/10/19 02:22:56 uwe Exp $");
#endif
#include <sh3/adcreg.h>
#include <sh3/dev/adcvar.h>
#define ADC_(x) (*((volatile uint8_t *)SH7709_AD ## x))
@ -57,8 +58,6 @@ CFATTACH_DECL(adc, sizeof(struct adc_softc),
static int adc_search(struct device *, struct cfdata *, void *);
static int adc_print(void *, const char *);
extern int adc_sample_channel(int); /* XXX: adcvar.h */
static int
adc_match(struct device *parent, struct cfdata *cfp, void *aux)

35
sys/arch/sh3/dev/adcvar.h Normal file
View File

@ -0,0 +1,35 @@
/* $NetBSD: adcvar.h,v 1.1 2003/10/22 23:52:46 uwe Exp $ */
/*
* Copyright (c) 2003 Valeriy E. Ushakov
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef _SH3_DEV_ADCVAR_H_
#define _SH3_DEV_ADCVAR_H_
extern int adc_sample_channel(int);
#endif /* _SH3_DEV_ADCVAR_H_ */