1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __ASM_CPU_SH3_DAC_H
3 #define __ASM_CPU_SH3_DAC_H
6 * Copyright (C) 2003 Andriy Skulysh
10 #define DADR0 0xa40000a0
11 #define DADR1 0xa40000a2
12 #define DACR 0xa40000a4
13 #define DACR_DAOE1 0x80
14 #define DACR_DAOE0 0x40
18 static __inline__
void sh_dac_enable(int channel
)
21 v
= __raw_readb(DACR
);
22 if(channel
) v
|= DACR_DAOE1
;
27 static __inline__
void sh_dac_disable(int channel
)
30 v
= __raw_readb(DACR
);
31 if(channel
) v
&= ~DACR_DAOE1
;
32 else v
&= ~DACR_DAOE0
;
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 */