treewide: remove redundant IS_ERR() before error code check
[linux/fpc-iii.git] / arch / sh / include / cpu-sh3 / cpu / dac.h
blobfd02331608a8d6b9e6e535ea44cfd7085953d4f0
1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_CPU_SH3_DAC_H
3 #define __ASM_CPU_SH3_DAC_H
5 /*
6 * Copyright (C) 2003 Andriy Skulysh
7 */
10 #define DADR0 0xa40000a0
11 #define DADR1 0xa40000a2
12 #define DACR 0xa40000a4
13 #define DACR_DAOE1 0x80
14 #define DACR_DAOE0 0x40
15 #define DACR_DAE 0x20
18 static __inline__ void sh_dac_enable(int channel)
20 unsigned char v;
21 v = __raw_readb(DACR);
22 if(channel) v |= DACR_DAOE1;
23 else v |= DACR_DAOE0;
24 __raw_writeb(v,DACR);
27 static __inline__ void sh_dac_disable(int channel)
29 unsigned char v;
30 v = __raw_readb(DACR);
31 if(channel) v &= ~DACR_DAOE1;
32 else v &= ~DACR_DAOE0;
33 __raw_writeb(v,DACR);
36 static __inline__ void sh_dac_output(u8 value, int channel)
38 if(channel) __raw_writeb(value,DADR1);
39 else __raw_writeb(value,DADR0);
42 #endif /* __ASM_CPU_SH3_DAC_H */