Skip to content

Commit fb2123f

Browse files
committedMay 22, 2012
Merge tag 'char-misc-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull Char/Misc patches from Greg Kroah-Hartman: "Here are a few various char/misc tree patches for the 3.5-rc1 merge window. Nothing major here at all, just different driver updates and some parport dead code removal. Signed-off-by: Greg Kroah-Hartman <[email protected]>" * tag 'char-misc-3.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: parport: remove unused dead code from lowlevel drivers xilinx_hwicap: reset XHI_MAX_RETRIES xilinx_hwicap: add support for virtex6 FPGAs Support M95040 SPI EEPROM misc: add support for bmp18x chips to the bmp085 driver misc: bmp085: add device tree properties misc: clean up bmp085 driver misc: do not mark exported functions __devexit misc: add missing __devexit_p() annotations pch_phub: delete duplicate definitions misc: Fix irq leak in max8997_muic_probe error path
2 parents a481991 + 9912143 commit fb2123f

22 files changed

+503
-571
lines changed
 
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
BMP085/BMP18x digital pressure sensors
2+
3+
Required properties:
4+
- compatible: bosch,bmp085
5+
6+
Optional properties:
7+
- chip-id: configurable chip id for non-default chip revisions
8+
- temp-measurement-period: temperature measurement period (milliseconds)
9+
- default-oversampling: default oversampling value to be used at startup,
10+
value range is 0-3 with rising sensitivity.
11+
12+
Example:
13+
14+
pressure@77 {
15+
compatible = "bosch,bmp085";
16+
reg = <0x77>;
17+
chip-id = <10>;
18+
temp-measurement-period = <100>;
19+
default-oversampling = <2>;
20+
};

‎Documentation/devicetree/bindings/vendor-prefixes.txt

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ amcc Applied Micro Circuits Corporation (APM, formally AMCC)
88
apm Applied Micro Circuits Corporation (APM)
99
arm ARM Ltd.
1010
atmel Atmel Corporation
11+
bosch Bosch Sensortec GmbH
1112
cavium Cavium, Inc.
1213
chrp Common Hardware Reference Platform
1314
cortina Cortina Systems, Inc.

‎drivers/char/xilinx_hwicap/xilinx_hwicap.c

+30
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ static const struct config_registers v4_config_registers = {
167167
.BOOTSTS = UNIMPLEMENTED,
168168
.CTL_1 = UNIMPLEMENTED,
169169
};
170+
170171
static const struct config_registers v5_config_registers = {
171172
.CRC = 0,
172173
.FAR = 1,
@@ -192,6 +193,31 @@ static const struct config_registers v5_config_registers = {
192193
.CTL_1 = 19,
193194
};
194195

196+
static const struct config_registers v6_config_registers = {
197+
.CRC = 0,
198+
.FAR = 1,
199+
.FDRI = 2,
200+
.FDRO = 3,
201+
.CMD = 4,
202+
.CTL = 5,
203+
.MASK = 6,
204+
.STAT = 7,
205+
.LOUT = 8,
206+
.COR = 9,
207+
.MFWR = 10,
208+
.FLR = UNIMPLEMENTED,
209+
.KEY = UNIMPLEMENTED,
210+
.CBC = 11,
211+
.IDCODE = 12,
212+
.AXSS = 13,
213+
.C0R_1 = 14,
214+
.CSOB = 15,
215+
.WBSTAR = 16,
216+
.TIMER = 17,
217+
.BOOTSTS = 22,
218+
.CTL_1 = 24,
219+
};
220+
195221
/**
196222
* hwicap_command_desync - Send a DESYNC command to the ICAP port.
197223
* @drvdata: a pointer to the drvdata.
@@ -744,6 +770,8 @@ static int __devinit hwicap_of_probe(struct platform_device *op,
744770
regs = &v4_config_registers;
745771
} else if (!strcmp(family, "virtex5")) {
746772
regs = &v5_config_registers;
773+
} else if (!strcmp(family, "virtex6")) {
774+
regs = &v6_config_registers;
747775
}
748776
}
749777
return hwicap_setup(&op->dev, id ? *id : -1, &res, config,
@@ -785,6 +813,8 @@ static int __devinit hwicap_drv_probe(struct platform_device *pdev)
785813
regs = &v4_config_registers;
786814
} else if (!strcmp(family, "virtex5")) {
787815
regs = &v5_config_registers;
816+
} else if (!strcmp(family, "virtex6")) {
817+
regs = &v6_config_registers;
788818
}
789819
}
790820

‎drivers/char/xilinx_hwicap/xilinx_hwicap.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ struct hwicap_driver_config {
8686
};
8787

8888
/* Number of times to poll the done regsiter */
89-
#define XHI_MAX_RETRIES 10
89+
#define XHI_MAX_RETRIES 5000
9090

9191
/************ Constant Definitions *************/
9292

‎drivers/misc/Kconfig

+22-4
Original file line numberDiff line numberDiff line change
@@ -452,14 +452,32 @@ config ARM_CHARLCD
452452
still useful.
453453

454454
config BMP085
455-
tristate "BMP085 digital pressure sensor"
455+
bool
456+
depends on SYSFS
457+
458+
config BMP085_I2C
459+
tristate "BMP085 digital pressure sensor on I2C"
460+
select BMP085
461+
select REGMAP_I2C
456462
depends on I2C && SYSFS
457463
help
458-
If you say yes here you get support for the Bosch Sensortec
459-
BMP085 digital pressure sensor.
464+
Say Y here if you want to support Bosch Sensortec's digital pressure
465+
sensor hooked to an I2C bus.
466+
467+
To compile this driver as a module, choose M here: the
468+
module will be called bmp085-i2c.
469+
470+
config BMP085_SPI
471+
tristate "BMP085 digital pressure sensor on SPI"
472+
select BMP085
473+
select REGMAP_SPI
474+
depends on SPI_MASTER && SYSFS
475+
help
476+
Say Y here if you want to support Bosch Sensortec's digital pressure
477+
sensor hooked to an SPI bus.
460478

461479
To compile this driver as a module, choose M here: the
462-
module will be called bmp085.
480+
module will be called bmp085-spi.
463481

464482
config PCH_PHUB
465483
tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) PHUB"

‎drivers/misc/Makefile

+2
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ obj-$(CONFIG_ATMEL_PWM) += atmel_pwm.o
1111
obj-$(CONFIG_ATMEL_SSC) += atmel-ssc.o
1212
obj-$(CONFIG_ATMEL_TCLIB) += atmel_tclib.o
1313
obj-$(CONFIG_BMP085) += bmp085.o
14+
obj-$(CONFIG_BMP085_I2C) += bmp085-i2c.o
15+
obj-$(CONFIG_BMP085_SPI) += bmp085-spi.o
1416
obj-$(CONFIG_ICS932S401) += ics932s401.o
1517
obj-$(CONFIG_LKDTM) += lkdtm.o
1618
obj-$(CONFIG_TIFM_CORE) += tifm_core.o

‎drivers/misc/ad525x_dpot.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -749,7 +749,7 @@ int __devinit ad_dpot_probe(struct device *dev,
749749
}
750750
EXPORT_SYMBOL(ad_dpot_probe);
751751

752-
__devexit int ad_dpot_remove(struct device *dev)
752+
int ad_dpot_remove(struct device *dev)
753753
{
754754
struct dpot_data *data = dev_get_drvdata(dev);
755755
int i;

‎drivers/misc/bh1780gli.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ static const struct i2c_device_id bh1780_id[] = {
248248

249249
static struct i2c_driver bh1780_driver = {
250250
.probe = bh1780_probe,
251-
.remove = bh1780_remove,
251+
.remove = __devexit_p(bh1780_remove),
252252
.id_table = bh1780_id,
253253
.driver = {
254254
.name = "bh1780",

‎drivers/misc/bmp085-i2c.c

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (c) 2012 Bosch Sensortec GmbH
3+
* Copyright (c) 2012 Unixphere AB
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18+
*/
19+
20+
#include <linux/module.h>
21+
#include <linux/i2c.h>
22+
#include <linux/err.h>
23+
#include "bmp085.h"
24+
25+
#define BMP085_I2C_ADDRESS 0x77
26+
27+
static const unsigned short normal_i2c[] = { BMP085_I2C_ADDRESS,
28+
I2C_CLIENT_END };
29+
30+
static int bmp085_i2c_detect(struct i2c_client *client,
31+
struct i2c_board_info *info)
32+
{
33+
if (client->addr != BMP085_I2C_ADDRESS)
34+
return -ENODEV;
35+
36+
return bmp085_detect(&client->dev);
37+
}
38+
39+
static int __devinit bmp085_i2c_probe(struct i2c_client *client,
40+
const struct i2c_device_id *id)
41+
{
42+
int err;
43+
struct regmap *regmap = devm_regmap_init_i2c(client,
44+
&bmp085_regmap_config);
45+
46+
if (IS_ERR(regmap)) {
47+
err = PTR_ERR(regmap);
48+
dev_err(&client->dev, "Failed to init regmap: %d\n", err);
49+
return err;
50+
}
51+
52+
return bmp085_probe(&client->dev, regmap);
53+
}
54+
55+
static int bmp085_i2c_remove(struct i2c_client *client)
56+
{
57+
return bmp085_remove(&client->dev);
58+
}
59+
60+
static const struct of_device_id bmp085_of_match[] = {
61+
{ .compatible = "bosch,bmp085", },
62+
{ },
63+
};
64+
MODULE_DEVICE_TABLE(of, bmp085_of_match);
65+
66+
static const struct i2c_device_id bmp085_id[] = {
67+
{ BMP085_NAME, 0 },
68+
{ "bmp180", 0 },
69+
{ }
70+
};
71+
MODULE_DEVICE_TABLE(i2c, bmp085_id);
72+
73+
static struct i2c_driver bmp085_i2c_driver = {
74+
.driver = {
75+
.owner = THIS_MODULE,
76+
.name = BMP085_NAME,
77+
.of_match_table = bmp085_of_match
78+
},
79+
.id_table = bmp085_id,
80+
.probe = bmp085_i2c_probe,
81+
.remove = __devexit_p(bmp085_i2c_remove),
82+
83+
.detect = bmp085_i2c_detect,
84+
.address_list = normal_i2c
85+
};
86+
87+
module_i2c_driver(bmp085_i2c_driver);
88+
89+
MODULE_AUTHOR("Eric Andersson <eric.andersson@unixphere.com>");
90+
MODULE_DESCRIPTION("BMP085 I2C bus driver");
91+
MODULE_LICENSE("GPL");

‎drivers/misc/bmp085-spi.c

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
/*
2+
* Copyright (c) 2012 Bosch Sensortec GmbH
3+
* Copyright (c) 2012 Unixphere AB
4+
*
5+
* This program is free software; you can redistribute it and/or modify
6+
* it under the terms of the GNU General Public License as published by
7+
* the Free Software Foundation; either version 2 of the License, or
8+
* (at your option) any later version.
9+
*
10+
* This program is distributed in the hope that it will be useful,
11+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
* GNU General Public License for more details.
14+
*
15+
* You should have received a copy of the GNU General Public License
16+
* along with this program; if not, write to the Free Software
17+
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18+
*/
19+
20+
#include <linux/module.h>
21+
#include <linux/spi/spi.h>
22+
#include <linux/err.h>
23+
#include "bmp085.h"
24+
25+
static int __devinit bmp085_spi_probe(struct spi_device *client)
26+
{
27+
int err;
28+
struct regmap *regmap;
29+
30+
client->bits_per_word = 8;
31+
err = spi_setup(client);
32+
if (err < 0) {
33+
dev_err(&client->dev, "spi_setup failed!\n");
34+
return err;
35+
}
36+
37+
regmap = devm_regmap_init_spi(client, &bmp085_regmap_config);
38+
if (IS_ERR(regmap)) {
39+
err = PTR_ERR(regmap);
40+
dev_err(&client->dev, "Failed to init regmap: %d\n", err);
41+
return err;
42+
}
43+
44+
return bmp085_probe(&client->dev, regmap);
45+
}
46+
47+
static int bmp085_spi_remove(struct spi_device *client)
48+
{
49+
return bmp085_remove(&client->dev);
50+
}
51+
52+
static const struct of_device_id bmp085_of_match[] = {
53+
{ .compatible = "bosch,bmp085", },
54+
{ },
55+
};
56+
MODULE_DEVICE_TABLE(of, bmp085_of_match);
57+
58+
static const struct spi_device_id bmp085_id[] = {
59+
{ "bmp180", 0 },
60+
{ "bmp181", 0 },
61+
{ }
62+
};
63+
MODULE_DEVICE_TABLE(spi, bmp085_id);
64+
65+
static struct spi_driver bmp085_spi_driver = {
66+
.driver = {
67+
.owner = THIS_MODULE,
68+
.name = BMP085_NAME,
69+
.of_match_table = bmp085_of_match
70+
},
71+
.id_table = bmp085_id,
72+
.probe = bmp085_spi_probe,
73+
.remove = __devexit_p(bmp085_spi_remove)
74+
};
75+
76+
static int __init bmp085_spi_init(void)
77+
{
78+
return spi_register_driver(&bmp085_spi_driver);
79+
}
80+
81+
static void __exit bmp085_spi_exit(void)
82+
{
83+
spi_unregister_driver(&bmp085_spi_driver);
84+
}
85+
86+
MODULE_AUTHOR("Eric Andersson <eric.andersson@unixphere.com>");
87+
MODULE_DESCRIPTION("BMP085 SPI bus driver");
88+
MODULE_LICENSE("GPL");
89+
90+
module_init(bmp085_spi_init);
91+
module_exit(bmp085_spi_exit);

0 commit comments

Comments
 (0)