Skip to content

Commit

Permalink
Merge tag 'char-misc-3.10-rc1' of git://git.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…kernel/git/gregkh/char-misc

Pull char/misc driver update from Greg Kroah-Hartman:
 "Here's the big char / misc driver update for 3.10-rc1

  A number of various driver updates, the majority being new
  functionality in the MEI driver subsystem (it's now a subsystem, it
  started out just a single driver), extcon updates, memory updates,
  hyper-v updates, and a bunch of other small stuff that doesn't fit in
  any other tree.

  All of these have been in linux-next for a while"

* tag 'char-misc-3.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (148 commits)
  Tools: hv: Fix a checkpatch warning
  tools: hv: skip iso9660 mounts in hv_vss_daemon
  tools: hv: use FIFREEZE/FITHAW in hv_vss_daemon
  tools: hv: use getmntent in hv_vss_daemon
  Tools: hv: Fix a checkpatch warning
  tools: hv: fix checks for origin of netlink message in hv_vss_daemon
  Tools: hv: fix warnings in hv_vss_daemon
  misc: mark spear13xx-pcie-gadget as broken
  mei: fix krealloc() misuse in in mei_cl_irq_read_msg()
  mei: reduce flow control only for completed messages
  mei: reseting -> resetting
  mei: fix reading large reposnes
  mei: revamp mei_irq_read_client_message function
  mei: revamp mei_amthif_irq_read_message
  mei: revamp hbm state machine
  Revert "drivers/scsi: use module_pcmcia_driver() in pcmcia drivers"
  Revert "scsi: pcmcia: nsp_cs: remove module init/exit function prototypes"
  scsi: pcmcia: nsp_cs: remove module init/exit function prototypes
  mei: wd: fix line over 80 characters
  misc: tsl2550: Use dev_pm_ops
  ...
  • Loading branch information
torvalds committed Apr 29, 2013
2 parents 92ddcf4 + 0e27263 commit 4f567cb
Show file tree
Hide file tree
Showing 131 changed files with 4,596 additions and 1,331 deletions.
7 changes: 7 additions & 0 deletions Documentation/ABI/testing/sysfs-bus-mei
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
What: /sys/bus/mei/devices/.../modalias
Date: March 2013
KernelVersion: 3.10
Contact: Samuel Ortiz <[email protected]>
[email protected]
Description: Stores the same MODALIAS value emitted by uevent
Format: mei:<mei device name>
18 changes: 18 additions & 0 deletions Documentation/devicetree/bindings/arm/msm/ssbi.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
* Qualcomm SSBI

Some Qualcomm MSM devices contain a point-to-point serial bus used to
communicate with a limited range of devices (mostly power management
chips).

These require the following properties:

- compatible: "qcom,ssbi"

- qcom,controller-type
indicates the SSBI bus variant the controller should use to talk
with the slave device. This should be one of "ssbi", "ssbi2", or
"pmic-arbiter". The type chosen is determined by the attached
slave.

The slave device should be the single child node of the ssbi device
with a compatible field.
138 changes: 138 additions & 0 deletions Documentation/misc-devices/mei/mei-client-bus.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
Intel(R) Management Engine (ME) Client bus API
===============================================


Rationale
=========
MEI misc character device is useful for dedicated applications to send and receive
data to the many FW appliance found in Intel's ME from the user space.
However for some of the ME functionalities it make sense to leverage existing software
stack and expose them through existing kernel subsystems.

In order to plug seamlessly into the kernel device driver model we add kernel virtual
bus abstraction on top of the MEI driver. This allows implementing linux kernel drivers
for the various MEI features as a stand alone entities found in their respective subsystem.
Existing device drivers can even potentially be re-used by adding an MEI CL bus layer to
the existing code.


MEI CL bus API
===========
A driver implementation for an MEI Client is very similar to existing bus
based device drivers. The driver registers itself as an MEI CL bus driver through
the mei_cl_driver structure:

struct mei_cl_driver {
struct device_driver driver;
const char *name;

const struct mei_cl_device_id *id_table;

int (*probe)(struct mei_cl_device *dev, const struct mei_cl_id *id);
int (*remove)(struct mei_cl_device *dev);
};

struct mei_cl_id {
char name[MEI_NAME_SIZE];
kernel_ulong_t driver_info;
};

The mei_cl_id structure allows the driver to bind itself against a device name.

To actually register a driver on the ME Client bus one must call the mei_cl_add_driver()
API. This is typically called at module init time.

Once registered on the ME Client bus, a driver will typically try to do some I/O on
this bus and this should be done through the mei_cl_send() and mei_cl_recv()
routines. The latter is synchronous (blocks and sleeps until data shows up).
In order for drivers to be notified of pending events waiting for them (e.g.
an Rx event) they can register an event handler through the
mei_cl_register_event_cb() routine. Currently only the MEI_EVENT_RX event
will trigger an event handler call and the driver implementation is supposed
to call mei_recv() from the event handler in order to fetch the pending
received buffers.


Example
=======
As a theoretical example let's pretend the ME comes with a "contact" NFC IP.
The driver init and exit routines for this device would look like:

#define CONTACT_DRIVER_NAME "contact"

static struct mei_cl_device_id contact_mei_cl_tbl[] = {
{ CONTACT_DRIVER_NAME, },

/* required last entry */
{ }
};
MODULE_DEVICE_TABLE(mei_cl, contact_mei_cl_tbl);

static struct mei_cl_driver contact_driver = {
.id_table = contact_mei_tbl,
.name = CONTACT_DRIVER_NAME,

.probe = contact_probe,
.remove = contact_remove,
};

static int contact_init(void)
{
int r;

r = mei_cl_driver_register(&contact_driver);
if (r) {
pr_err(CONTACT_DRIVER_NAME ": driver registration failed\n");
return r;
}

return 0;
}

static void __exit contact_exit(void)
{
mei_cl_driver_unregister(&contact_driver);
}

module_init(contact_init);
module_exit(contact_exit);

And the driver's simplified probe routine would look like that:

int contact_probe(struct mei_cl_device *dev, struct mei_cl_device_id *id)
{
struct contact_driver *contact;

[...]
mei_cl_enable_device(dev);

mei_cl_register_event_cb(dev, contact_event_cb, contact);

return 0;
}

In the probe routine the driver first enable the MEI device and then registers
an ME bus event handler which is as close as it can get to registering a
threaded IRQ handler.
The handler implementation will typically call some I/O routine depending on
the pending events:

#define MAX_NFC_PAYLOAD 128

static void contact_event_cb(struct mei_cl_device *dev, u32 events,
void *context)
{
struct contact_driver *contact = context;

if (events & BIT(MEI_EVENT_RX)) {
u8 payload[MAX_NFC_PAYLOAD];
int payload_size;

payload_size = mei_recv(dev, payload, MAX_NFC_PAYLOAD);
if (payload_size <= 0)
return;

/* Hook to the NFC subsystem */
nfc_hci_recv_frame(contact->hdev, payload, payload_size);
}
}
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -1031,6 +1031,7 @@ F: drivers/mmc/host/msm_sdcc.h
F: drivers/tty/serial/msm_serial.h
F: drivers/tty/serial/msm_serial.c
F: drivers/*/pm8???-*
F: drivers/ssbi/
F: include/linux/mfd/pm8xxx/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/davidb/linux-msm.git
S: Maintained
Expand Down
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/msm8660-surf.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@
<0x19c00000 0x1000>;
interrupts = <0 195 0x0>;
};

qcom,ssbi@500000 {
compatible = "qcom,ssbi";
reg = <0x500000 0x1000>;
qcom,controller-type = "pmic-arbiter";
};
};
6 changes: 6 additions & 0 deletions arch/arm/boot/dts/msm8960-cdp.dts
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,10 @@
<0x16400000 0x1000>;
interrupts = <0 154 0x0>;
};

qcom,ssbi@500000 {
compatible = "qcom,ssbi";
reg = <0x500000 0x1000>;
qcom,controller-type = "pmic-arbiter";
};
};
2 changes: 2 additions & 0 deletions drivers/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ source "drivers/i2c/Kconfig"

source "drivers/spi/Kconfig"

source "drivers/ssbi/Kconfig"

source "drivers/hsi/Kconfig"

source "drivers/pps/Kconfig"
Expand Down
1 change: 1 addition & 0 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ obj-y += firmware/
obj-$(CONFIG_CRYPTO) += crypto/
obj-$(CONFIG_SUPERH) += sh/
obj-$(CONFIG_ARCH_SHMOBILE) += sh/
obj-$(CONFIG_SSBI) += ssbi/
ifndef CONFIG_ARCH_USES_GETTIMEOFFSET
obj-y += clocksource/
endif
Expand Down
14 changes: 1 addition & 13 deletions drivers/ata/pata_pcmcia.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,21 +387,9 @@ static struct pcmcia_driver pcmcia_driver = {
.probe = pcmcia_init_one,
.remove = pcmcia_remove_one,
};

static int __init pcmcia_init(void)
{
return pcmcia_register_driver(&pcmcia_driver);
}

static void __exit pcmcia_exit(void)
{
pcmcia_unregister_driver(&pcmcia_driver);
}
module_pcmcia_driver(pcmcia_driver);

MODULE_AUTHOR("Alan Cox");
MODULE_DESCRIPTION("low-level driver for PCMCIA ATA");
MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);

module_init(pcmcia_init);
module_exit(pcmcia_exit);
15 changes: 1 addition & 14 deletions drivers/bluetooth/bluecard_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -934,17 +934,4 @@ static struct pcmcia_driver bluecard_driver = {
.remove = bluecard_detach,
.id_table = bluecard_ids,
};

static int __init init_bluecard_cs(void)
{
return pcmcia_register_driver(&bluecard_driver);
}


static void __exit exit_bluecard_cs(void)
{
pcmcia_unregister_driver(&bluecard_driver);
}

module_init(init_bluecard_cs);
module_exit(exit_bluecard_cs);
module_pcmcia_driver(bluecard_driver);
15 changes: 1 addition & 14 deletions drivers/bluetooth/bt3c_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -760,17 +760,4 @@ static struct pcmcia_driver bt3c_driver = {
.remove = bt3c_detach,
.id_table = bt3c_ids,
};

static int __init init_bt3c_cs(void)
{
return pcmcia_register_driver(&bt3c_driver);
}


static void __exit exit_bt3c_cs(void)
{
pcmcia_unregister_driver(&bt3c_driver);
}

module_init(init_bt3c_cs);
module_exit(exit_bt3c_cs);
module_pcmcia_driver(bt3c_driver);
15 changes: 1 addition & 14 deletions drivers/bluetooth/btuart_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -688,17 +688,4 @@ static struct pcmcia_driver btuart_driver = {
.remove = btuart_detach,
.id_table = btuart_ids,
};

static int __init init_btuart_cs(void)
{
return pcmcia_register_driver(&btuart_driver);
}


static void __exit exit_btuart_cs(void)
{
pcmcia_unregister_driver(&btuart_driver);
}

module_init(init_btuart_cs);
module_exit(exit_btuart_cs);
module_pcmcia_driver(btuart_driver);
15 changes: 1 addition & 14 deletions drivers/bluetooth/dtl1_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -628,17 +628,4 @@ static struct pcmcia_driver dtl1_driver = {
.remove = dtl1_detach,
.id_table = dtl1_ids,
};

static int __init init_dtl1_cs(void)
{
return pcmcia_register_driver(&dtl1_driver);
}


static void __exit exit_dtl1_cs(void)
{
pcmcia_unregister_driver(&dtl1_driver);
}

module_init(init_dtl1_cs);
module_exit(exit_dtl1_cs);
module_pcmcia_driver(dtl1_driver);
4 changes: 2 additions & 2 deletions drivers/char/applicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -804,8 +804,8 @@ static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)

printk(KERN_INFO "Prom version board %d ....... V%d.%d %s",
i+1,
(int)(readb(apbs[IndexCard].RamIO + VERS) >> 4),
(int)(readb(apbs[IndexCard].RamIO + VERS) & 0xF),
(int)(readb(apbs[i].RamIO + VERS) >> 4),
(int)(readb(apbs[i].RamIO + VERS) & 0xF),
boardname);


Expand Down
13 changes: 1 addition & 12 deletions drivers/char/hw_random/mxc-rnga.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,18 +228,7 @@ static struct platform_driver mxc_rnga_driver = {
.remove = __exit_p(mxc_rnga_remove),
};

static int __init mod_init(void)
{
return platform_driver_probe(&mxc_rnga_driver, mxc_rnga_probe);
}

static void __exit mod_exit(void)
{
platform_driver_unregister(&mxc_rnga_driver);
}

module_init(mod_init);
module_exit(mod_exit);
module_platform_driver_probe(mxc_rnga_driver, mxc_rnga_probe);

MODULE_AUTHOR("Freescale Semiconductor, Inc.");
MODULE_DESCRIPTION("H/W RNGA driver for i.MX");
Expand Down
13 changes: 1 addition & 12 deletions drivers/char/hw_random/tx4939-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,18 +166,7 @@ static struct platform_driver tx4939_rng_driver = {
.remove = tx4939_rng_remove,
};

static int __init tx4939rng_init(void)
{
return platform_driver_probe(&tx4939_rng_driver, tx4939_rng_probe);
}

static void __exit tx4939rng_exit(void)
{
platform_driver_unregister(&tx4939_rng_driver);
}

module_init(tx4939rng_init);
module_exit(tx4939rng_exit);
module_platform_driver_probe(tx4939_rng_driver, tx4939_rng_probe);

MODULE_DESCRIPTION("H/W Random Number Generator (RNG) driver for TX4939");
MODULE_LICENSE("GPL");
2 changes: 1 addition & 1 deletion drivers/char/tile-srom.c
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ static int srom_setup_minor(struct srom_dev *srom, int index)

dev = device_create(srom_class, &platform_bus,
MKDEV(srom_major, index), srom, "%d", index);
return IS_ERR(dev) ? PTR_ERR(dev) : 0;
return PTR_RET(dev);
}

/** srom_init() - Initialize the driver's module. */
Expand Down
Loading

0 comments on commit 4f567cb

Please sign in to comment.