~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/powerpc/include/asm/pmac_low_i2c.h

Version: ~ [ linux-5.4-rc7 ] ~ [ linux-5.3.11 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.84 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.154 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.201 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.201 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.77 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* 
  2  *  include/asm-ppc/pmac_low_i2c.h
  3  *
  4  *  Copyright (C) 2003 Ben. Herrenschmidt (benh@kernel.crashing.org)
  5  *
  6  *  This program is free software; you can redistribute it and/or
  7  *  modify it under the terms of the GNU General Public License
  8  *  as published by the Free Software Foundation; either version
  9  *  2 of the License, or (at your option) any later version.
 10  *
 11  */
 12 #ifndef __PMAC_LOW_I2C_H__
 13 #define __PMAC_LOW_I2C_H__
 14 #ifdef __KERNEL__
 15 
 16 /* i2c mode (based on the platform functions format) */
 17 enum {
 18         pmac_i2c_mode_dumb      = 1,
 19         pmac_i2c_mode_std       = 2,
 20         pmac_i2c_mode_stdsub    = 3,
 21         pmac_i2c_mode_combined  = 4,
 22 };
 23 
 24 /* RW bit in address */
 25 enum {
 26         pmac_i2c_read           = 0x01,
 27         pmac_i2c_write          = 0x00
 28 };
 29 
 30 /* i2c bus type */
 31 enum {
 32         pmac_i2c_bus_keywest    = 0,
 33         pmac_i2c_bus_pmu        = 1,
 34         pmac_i2c_bus_smu        = 2,
 35 };
 36 
 37 /* i2c bus features */
 38 enum {
 39         /* can_largesub : supports >1 byte subaddresses (SMU only) */
 40         pmac_i2c_can_largesub   = 0x00000001u,
 41 
 42         /* multibus : device node holds multiple busses, bus number is
 43          * encoded in bits 0xff00 of "reg" of a given device
 44          */
 45         pmac_i2c_multibus       = 0x00000002u,
 46 };
 47 
 48 /* i2c busses in the system */
 49 struct pmac_i2c_bus;
 50 struct i2c_adapter;
 51 
 52 /* Init, called early during boot */
 53 extern int pmac_i2c_init(void);
 54 
 55 /* Lookup an i2c bus for a device-node. The node can be either the bus
 56  * node itself or a device below it. In the case of a multibus, the bus
 57  * node itself is the controller node, else, it's a child of the controller
 58  * node
 59  */
 60 extern struct pmac_i2c_bus *pmac_i2c_find_bus(struct device_node *node);
 61 
 62 /* Get the address for an i2c device. This strips the bus number if
 63  * necessary. The 7 bits address is returned 1 bit right shifted so that the
 64  * direction can be directly ored in
 65  */
 66 extern u8 pmac_i2c_get_dev_addr(struct device_node *device);
 67 
 68 /* Get infos about a bus */
 69 extern struct device_node *pmac_i2c_get_controller(struct pmac_i2c_bus *bus);
 70 extern struct device_node *pmac_i2c_get_bus_node(struct pmac_i2c_bus *bus);
 71 extern int pmac_i2c_get_type(struct pmac_i2c_bus *bus);
 72 extern int pmac_i2c_get_flags(struct pmac_i2c_bus *bus);
 73 extern int pmac_i2c_get_channel(struct pmac_i2c_bus *bus);
 74 
 75 /* i2c layer adapter helpers */
 76 extern struct i2c_adapter *pmac_i2c_get_adapter(struct pmac_i2c_bus *bus);
 77 extern struct pmac_i2c_bus *pmac_i2c_adapter_to_bus(struct i2c_adapter *adapter);
 78 
 79 /* March a device or bus with an i2c adapter structure, to be used by drivers
 80  * to match device-tree nodes with i2c adapters during adapter discovery
 81  * callbacks
 82  */
 83 extern int pmac_i2c_match_adapter(struct device_node *dev,
 84                                   struct i2c_adapter *adapter);
 85 
 86 
 87 /* (legacy) Locking functions exposed to i2c-keywest */
 88 extern int pmac_low_i2c_lock(struct device_node *np);
 89 extern int pmac_low_i2c_unlock(struct device_node *np);
 90 
 91 /* Access functions for platform code */
 92 extern int pmac_i2c_open(struct pmac_i2c_bus *bus, int polled);
 93 extern void pmac_i2c_close(struct pmac_i2c_bus *bus);
 94 extern int pmac_i2c_setmode(struct pmac_i2c_bus *bus, int mode);
 95 extern int pmac_i2c_xfer(struct pmac_i2c_bus *bus, u8 addrdir, int subsize,
 96                          u32 subaddr, u8 *data,  int len);
 97 
 98 /* Suspend/resume code called by via-pmu directly for now */
 99 extern void pmac_pfunc_i2c_suspend(void);
100 extern void pmac_pfunc_i2c_resume(void);
101 
102 #endif /* __KERNEL__ */
103 #endif /* __PMAC_LOW_I2C_H__ */
104 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp