forked from Minki/linux
c942fddf87
Based on 3 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation either version 2 of the license or at your option any later version [author] [graeme] [gregory] [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i] [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema] [hk] [hemahk]@[ti] [com] this program is distributed in the hope that it will be useful but without any warranty without even the implied warranty of merchantability or fitness for a particular purpose see the gnu general public license for more details extracted by the scancode license scanner the SPDX license identifier GPL-2.0-or-later has been chosen to replace the boilerplate/reference in 1105 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Allison Randal <allison@lohutok.net> Reviewed-by: Richard Fontana <rfontana@redhat.com> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
66 lines
2.2 KiB
C
66 lines
2.2 KiB
C
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/* -------------------------------------------------------------------- */
|
|
/* i2c-pcf8584.h: PCF 8584 global defines */
|
|
/* -------------------------------------------------------------------- */
|
|
/* Copyright (C) 1996 Simon G. Vogl
|
|
1999 Hans Berglund
|
|
|
|
*/
|
|
/* -------------------------------------------------------------------- */
|
|
|
|
/* With some changes from Frodo Looijaard <frodol@dds.nl> */
|
|
|
|
#ifndef I2C_PCF8584_H
|
|
#define I2C_PCF8584_H 1
|
|
|
|
/* ----- Control register bits ---------------------------------------- */
|
|
#define I2C_PCF_PIN 0x80
|
|
#define I2C_PCF_ESO 0x40
|
|
#define I2C_PCF_ES1 0x20
|
|
#define I2C_PCF_ES2 0x10
|
|
#define I2C_PCF_ENI 0x08
|
|
#define I2C_PCF_STA 0x04
|
|
#define I2C_PCF_STO 0x02
|
|
#define I2C_PCF_ACK 0x01
|
|
|
|
#define I2C_PCF_START (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
|
|
#define I2C_PCF_STOP (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_STO | I2C_PCF_ACK)
|
|
#define I2C_PCF_REPSTART ( I2C_PCF_ESO | I2C_PCF_STA | I2C_PCF_ACK)
|
|
#define I2C_PCF_IDLE (I2C_PCF_PIN | I2C_PCF_ESO | I2C_PCF_ACK)
|
|
|
|
/* ----- Status register bits ----------------------------------------- */
|
|
/*#define I2C_PCF_PIN 0x80 as above*/
|
|
|
|
#define I2C_PCF_INI 0x40 /* 1 if not initialized */
|
|
#define I2C_PCF_STS 0x20
|
|
#define I2C_PCF_BER 0x10
|
|
#define I2C_PCF_AD0 0x08
|
|
#define I2C_PCF_LRB 0x08
|
|
#define I2C_PCF_AAS 0x04
|
|
#define I2C_PCF_LAB 0x02
|
|
#define I2C_PCF_BB 0x01
|
|
|
|
/* ----- Chip clock frequencies --------------------------------------- */
|
|
#define I2C_PCF_CLK3 0x00
|
|
#define I2C_PCF_CLK443 0x10
|
|
#define I2C_PCF_CLK6 0x14
|
|
#define I2C_PCF_CLK 0x18
|
|
#define I2C_PCF_CLK12 0x1c
|
|
|
|
/* ----- transmission frequencies ------------------------------------- */
|
|
#define I2C_PCF_TRNS90 0x00 /* 90 kHz */
|
|
#define I2C_PCF_TRNS45 0x01 /* 45 kHz */
|
|
#define I2C_PCF_TRNS11 0x02 /* 11 kHz */
|
|
#define I2C_PCF_TRNS15 0x03 /* 1.5 kHz */
|
|
|
|
|
|
/* ----- Access to internal registers according to ES1,ES2 ------------ */
|
|
/* they are mapped to the data port ( a0 = 0 ) */
|
|
/* available when ESO == 0 : */
|
|
|
|
#define I2C_PCF_OWNADR 0
|
|
#define I2C_PCF_INTREG I2C_PCF_ES2
|
|
#define I2C_PCF_CLKREG I2C_PCF_ES1
|
|
|
|
#endif /* I2C_PCF8584_H */
|