diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 19:16:26 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 19:16:26 -0400 |
| commit | acceba598eda9817bc187f3a683a2d2ee7e7fbc7 (patch) | |
| tree | 761b3950789d5eee179b75ecdafafc988ee42a46 /include/linux | |
| parent | c19176154b464c861e49355eff636aa6896735b5 (diff) | |
| parent | 5a73882fd2c3a86b502d54da532d373a1f2db15e (diff) | |
Merge branch 'i2c/for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux
Pull i2c updates from Wolfram Sang:
"Features:
- new drivers: Renesas EMEV2, register based MUX, NXP LPC2xxx
- core: scans DT and assigns wakeup interrupts. no driver changes needed.
- core: some refcouting issues fixed and better API for that
- core: new helper function for best effort block read emulation
- slave framework: proper DT bindings and userspace instantiation
- some bigger work for xiic, pxa, omap drivers
.. and quite a number of smaller driver fixes, cleanups, improvements"
* 'i2c/for-4.3' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux: (65 commits)
i2c: mux: reg Change ioread endianness for readback
i2c: mux: reg: fix compilation warnings
i2c: mux: reg: simplify register size checking
i2c: muxes: fix leaked i2c adapter device node references
i2c: allow specifying separate wakeup interrupt in device tree
of/irq: export of_get_irq_byname()
i2c: xgene-slimpro: dma_mapping_error() doesn't return an error code
i2c: Replace I2C_CROS_EC_TUNNEL dependency
eeprom: at24: use i2c_smbus_read_i2c_block_data_or_emulated
i2c: core: Add support for best effort block read emulation
i2c: lpc2k: add driver
i2c: mux: Add register-based mux i2c-mux-reg
i2c: dt: describe generic bindings
i2c: slave: print warning if slave flag not set
i2c: support 10 bit and slave addresses in sysfs 'new_device'
i2c: take address space into account when checking for used addresses
i2c: apply DT flags when probing
i2c: make address check indpendent from client struct
i2c: rename address check functions
i2c: apply address offset for slaves, too
...
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/i2c.h | 19 | ||||
| -rw-r--r-- | include/linux/platform_data/i2c-mux-reg.h | 44 |
2 files changed, 59 insertions, 4 deletions
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index e83a738a3b87..768063baafbf 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
| @@ -121,6 +121,9 @@ extern s32 i2c_smbus_read_i2c_block_data(const struct i2c_client *client, | |||
| 121 | extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, | 121 | extern s32 i2c_smbus_write_i2c_block_data(const struct i2c_client *client, |
| 122 | u8 command, u8 length, | 122 | u8 command, u8 length, |
| 123 | const u8 *values); | 123 | const u8 *values); |
| 124 | extern s32 | ||
| 125 | i2c_smbus_read_i2c_block_data_or_emulated(const struct i2c_client *client, | ||
| 126 | u8 command, u8 length, u8 *values); | ||
| 124 | #endif /* I2C */ | 127 | #endif /* I2C */ |
| 125 | 128 | ||
| 126 | /** | 129 | /** |
| @@ -550,11 +553,12 @@ void i2c_lock_adapter(struct i2c_adapter *); | |||
| 550 | void i2c_unlock_adapter(struct i2c_adapter *); | 553 | void i2c_unlock_adapter(struct i2c_adapter *); |
| 551 | 554 | ||
| 552 | /*flags for the client struct: */ | 555 | /*flags for the client struct: */ |
| 553 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ | 556 | #define I2C_CLIENT_PEC 0x04 /* Use Packet Error Checking */ |
| 554 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ | 557 | #define I2C_CLIENT_TEN 0x10 /* we have a ten bit chip address */ |
| 555 | /* Must equal I2C_M_TEN below */ | 558 | /* Must equal I2C_M_TEN below */ |
| 556 | #define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ | 559 | #define I2C_CLIENT_SLAVE 0x20 /* we are the slave */ |
| 557 | #define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */ | 560 | #define I2C_CLIENT_WAKE 0x80 /* for board_info; true iff can wake */ |
| 561 | #define I2C_CLIENT_SCCB 0x9000 /* Use Omnivision SCCB protocol */ | ||
| 558 | /* Must match I2C_M_STOP|IGNORE_NAK */ | 562 | /* Must match I2C_M_STOP|IGNORE_NAK */ |
| 559 | 563 | ||
| 560 | /* i2c adapter classes (bitmask) */ | 564 | /* i2c adapter classes (bitmask) */ |
| @@ -638,6 +642,8 @@ extern struct i2c_client *of_find_i2c_device_by_node(struct device_node *node); | |||
| 638 | /* must call put_device() when done with returned i2c_adapter device */ | 642 | /* must call put_device() when done with returned i2c_adapter device */ |
| 639 | extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node); | 643 | extern struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node *node); |
| 640 | 644 | ||
| 645 | /* must call i2c_put_adapter() when done with returned i2c_adapter device */ | ||
| 646 | struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node); | ||
| 641 | #else | 647 | #else |
| 642 | 648 | ||
| 643 | static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) | 649 | static inline struct i2c_client *of_find_i2c_device_by_node(struct device_node *node) |
| @@ -649,6 +655,11 @@ static inline struct i2c_adapter *of_find_i2c_adapter_by_node(struct device_node | |||
| 649 | { | 655 | { |
| 650 | return NULL; | 656 | return NULL; |
| 651 | } | 657 | } |
| 658 | |||
| 659 | static inline struct i2c_adapter *of_get_i2c_adapter_by_node(struct device_node *node) | ||
| 660 | { | ||
| 661 | return NULL; | ||
| 662 | } | ||
| 652 | #endif /* CONFIG_OF */ | 663 | #endif /* CONFIG_OF */ |
| 653 | 664 | ||
| 654 | #endif /* _LINUX_I2C_H */ | 665 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/platform_data/i2c-mux-reg.h b/include/linux/platform_data/i2c-mux-reg.h new file mode 100644 index 000000000000..c68712aadf43 --- /dev/null +++ b/include/linux/platform_data/i2c-mux-reg.h | |||
| @@ -0,0 +1,44 @@ | |||
| 1 | /* | ||
| 2 | * I2C multiplexer using a single register | ||
| 3 | * | ||
| 4 | * Copyright 2015 Freescale Semiconductor | ||
| 5 | * York Sun <yorksun@freescale.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms of the GNU General Public License as published by the | ||
| 9 | * Free Software Foundation; either version 2 of the License, or (at your | ||
| 10 | * option) any later version. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #ifndef __LINUX_PLATFORM_DATA_I2C_MUX_REG_H | ||
| 14 | #define __LINUX_PLATFORM_DATA_I2C_MUX_REG_H | ||
| 15 | |||
| 16 | /** | ||
| 17 | * struct i2c_mux_reg_platform_data - Platform-dependent data for i2c-mux-reg | ||
| 18 | * @parent: Parent I2C bus adapter number | ||
| 19 | * @base_nr: Base I2C bus number to number adapters from or zero for dynamic | ||
| 20 | * @values: Array of value for each channel | ||
| 21 | * @n_values: Number of multiplexer channels | ||
| 22 | * @little_endian: Indicating if the register is in little endian | ||
| 23 | * @write_only: Reading the register is not allowed by hardware | ||
| 24 | * @classes: Optional I2C auto-detection classes | ||
| 25 | * @idle: Value to write to mux when idle | ||
| 26 | * @idle_in_use: indicate if idle value is in use | ||
| 27 | * @reg: Virtual address of the register to switch channel | ||
| 28 | * @reg_size: register size in bytes | ||
| 29 | */ | ||
| 30 | struct i2c_mux_reg_platform_data { | ||
| 31 | int parent; | ||
| 32 | int base_nr; | ||
| 33 | const unsigned int *values; | ||
| 34 | int n_values; | ||
| 35 | bool little_endian; | ||
| 36 | bool write_only; | ||
| 37 | const unsigned int *classes; | ||
| 38 | u32 idle; | ||
| 39 | bool idle_in_use; | ||
| 40 | void __iomem *reg; | ||
| 41 | resource_size_t reg_size; | ||
| 42 | }; | ||
| 43 | |||
| 44 | #endif /* __LINUX_PLATFORM_DATA_I2C_MUX_REG_H */ | ||
