lkml.org 
[lkml]   [2016]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 2/2] i2c: mux: mellanox: add driver
Hi Vadim,

[auto build test WARNING on wsa/i2c/for-next]
[also build test WARNING on v4.8-rc3 next-20160825]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
[Suggest to use git(>=2.9.0) format-patch --base=<commit> (or --base=auto for convenience) to record what (public, well-known) commit your patch series was built on]
[Check https://git-scm.com/docs/git-format-patch for more information]

url: https://github.com/0day-ci/linux/commits/vadimp-mellanox-com/i2c-add-master-driver-for-mellanox-systems/20160828-225625
base: https://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git i2c/for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 4.9.0
reproduce:
wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=m68k

All warnings (new ones prefixed by >>):

In file included from arch/m68k/include/asm/io_mm.h:26:0,
from arch/m68k/include/asm/io.h:4,
from include/linux/io.h:25,
from drivers/i2c/muxes/i2c-mux-mlxcpld.c:42:
drivers/i2c/muxes/i2c-mux-mlxcpld.c: In function 'mlxcpld_mux_reg_write':
arch/m68k/include/asm/raw_io.h:43:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
#define out_8(addr,b) (void)((*(__force volatile u8 *) (addr)) = (b))
^
arch/m68k/include/asm/io_mm.h:396:72: note: in expansion of macro 'out_8'
#define outb(val, port) ((port) < 1024 ? isa_rom_outb((val), (port)) : out_8((port), (val)))
^
>> drivers/i2c/muxes/i2c-mux-mlxcpld.c:164:3: note: in expansion of macro 'outb'
outb(val, pdata->addr); /* addr = CPLD base + offset */
^

vim +/outb +164 drivers/i2c/muxes/i2c-mux-mlxcpld.c

36 #include <linux/version.h>
37 #include <linux/init.h>
38 #include <linux/slab.h>
39 #include <linux/device.h>
40 #include <linux/i2c.h>
41 #include <linux/i2c-mux.h>
> 42 #include <linux/io.h>
43 #include <linux/platform_device.h>
44 #include <linux/i2c/mlxcpld.h>
45
46 #define CPLD_MUX_MAX_NCHANS 8
47 #define CPLD_MUX_EXT_MAX_NCHANS 24
48
49 /*
50 * mlxcpld_mux types - kind of mux supported by driver:
51 * @mlxcpld_mux_tor - LPC access; 8 channels.
52 * @mlxcpld_mux_mgmt - LPC access; 8 channels.
53 * @mlxcpld_mux_mgmt_ext - LPC access; 24 channels.
54 * @mlxcpld_mux_module - I2C access; 8 channels/legs.
55 */
56 enum mlxcpld_mux_type {
57 mlxcpld_mux_tor,
58 mlxcpld_mux_mgmt,
59 mlxcpld_mux_mgmt_ext,
60 mlxcpld_mux_module,
61 };
62
63 /* mlxcpld_mux_type - underlying physical bus, to which device is connected:
64 * @lpc_access - LPC connected CPLD device
65 * @i2c_access - I2C connected CPLD device
66 */
67 enum mlxcpld_mux_access_type {
68 lpc_access,
69 i2c_access,
70 };
71
72 /* mlxcpld_mux - mux control structure:
73 * @type - mux type
74 * @last_chan - last register value
75 * @client - I2C device client
76 */
77 struct mlxcpld_mux {
78 enum mlxcpld_mux_type type;
79 u8 last_chan;
80 struct i2c_client *client;
81 };
82
83 /* mlxcpld_mux_desc - mux descriptor structure:
84 * @nchans - number of channels
85 * @muxtype - physical mux type (LPC or I2C)
86 */
87 struct mlxcpld_mux_desc {
88 u8 nchans;
89 enum mlxcpld_mux_access_type muxtype;
90 };
91
92 /* MUX logic description.
93 * This logic can be applied for LPC attached CPLD and fro I2C attached CPLD.
94 * Driver can support different mux control logic, according to CPLD
95 * implementation.
96 *
97 * Connectivity schema.
98 *
99 * i2c-mlxcpld Digital Analog
100 * driver
101 * *--------* * -> mux1 (virt bus2) -> mux -> |
102 * | I2CLPC | i2c physical * -> mux2 (virt bus3) -> mux -> |
103 * | bridge | bus 1 *---------* |
104 * | logic |---------------------> * mux reg * |
105 * | in CPLD| *---------* |
106 * *--------* i2c-mux-mlxpcld ^ * -> muxn (virt busn) -> mux -> |
107 * | driver | |
108 * | *---------------* | Devices
109 * | * CPLD (LPC bus)* select |
110 * | * registers for *--------*
111 * | * mux selection * deselect
112 * | *---------------*
113 * | |
114 * <--------> <----------->
115 * i2c cntrl Board cntrl reg
116 * reg space space (mux select,
117 * | IO, LED, WD, info)
118 * | | *-----* *-----*
119 * *------------- LPC bus --------------| PCH |---| CPU |
120 * *-----* *-----*
121 *
122 */
123 static const struct mlxcpld_mux_desc muxes[] = {
124 [mlxcpld_mux_tor] = {
125 .nchans = CPLD_MUX_MAX_NCHANS,
126 .muxtype = lpc_access,
127 },
128 [mlxcpld_mux_mgmt] = {
129 .nchans = CPLD_MUX_MAX_NCHANS,
130 .muxtype = lpc_access,
131 },
132 [mlxcpld_mux_mgmt_ext] = {
133 .nchans = CPLD_MUX_EXT_MAX_NCHANS,
134 .muxtype = lpc_access,
135 },
136 [mlxcpld_mux_module] = {
137 .nchans = CPLD_MUX_MAX_NCHANS,
138 .muxtype = i2c_access,
139 },
140 };
141
142 static const struct i2c_device_id mlxcpld_mux_id[] = {
143 { "mlxcpld_mux_tor", mlxcpld_mux_tor },
144 { "mlxcpld_mux_mgmt", mlxcpld_mux_mgmt },
145 { "mlxcpld_mux_mgmt_ext", mlxcpld_mux_mgmt_ext },
146 { "mlxcpld_mux_module", mlxcpld_mux_module },
147 { }
148 };
149 MODULE_DEVICE_TABLE(i2c, mlxcpld_mux_id);
150
151 /* Write to mux register. Don't use i2c_transfer() and
152 * i2c_smbus_xfer() for this as they will try to lock adapter a second time
153 */
154 static int mlxcpld_mux_reg_write(struct i2c_adapter *adap,
155 struct i2c_client *client, u8 val,
156 enum mlxcpld_mux_access_type muxtype)
157 {
158 struct mlxcpld_mux_platform_data *pdata =
159 dev_get_platdata(&client->dev);
160 int ret = -ENODEV;
161
162 switch (muxtype) {
163 case lpc_access:
> 164 outb(val, pdata->addr); /* addr = CPLD base + offset */
165 ret = 1;
166 break;
167

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[unhandled content-type:application/octet-stream]
\
 
 \ /
  Last update: 2016-09-17 09:58    [W:0.163 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site