Skip to content

Commit

Permalink
Merge tag 'char-misc-3.16-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 into next

Pull char/misc driver patches from Greg KH:
 "Here is the big char / misc driver update for 3.16-rc1.

  Lots of different driver updates for a variety of different drivers
  and minor driver subsystems.

  All have been in linux-next with no reported issues"

* tag 'char-misc-3.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (79 commits)
  hv: use correct order when freeing monitor_pages
  spmi: of: fixup generic SPMI devicetree binding example
  applicom: dereferencing NULL on error path
  misc: genwqe: fix uninitialized return value in genwqe_free_sync_sgl()
  miscdevice.h: Simple syntax fix to make pointers consistent.
  MAINTAINERS: Add miscdevice.h to file list for char/misc drivers.
  mcb: Add support for shared PCI IRQs
  drivers: Remove duplicate conditionally included subdirs
  misc: atmel_pwm: only build for supported platforms
  mei: me: move probe quirk to cfg structure
  mei: add per device configuration
  mei: me: read H_CSR after asserting reset
  mei: me: drop harmful wait optimization
  mei: me: fix hw ready reset flow
  mei: fix memory leak of mei_clients array
  uio: fix vma io range check in mmap
  drivers: uio_dmem_genirq: Fix memory leak in uio_dmem_genirq_probe()
  w1: do not unlock unheld list_mutex in __w1_remove_master_device()
  w1: optional bundling of netlink kernel replies
  connector: allow multiple messages to be sent in one packet
  ...
  • Loading branch information
torvalds committed Jun 3, 2014
2 parents b55a0ff + a100d88 commit 4046136
Show file tree
Hide file tree
Showing 68 changed files with 2,931 additions and 787 deletions.
15 changes: 11 additions & 4 deletions Documentation/connector/connector.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ netlink based networking for inter-process communication in a significantly
easier way:

int cn_add_callback(struct cb_id *id, char *name, void (*callback) (struct cn_msg *, struct netlink_skb_parms *));
void cn_netlink_send(struct cn_msg *msg, u32 __group, int gfp_mask);
void cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __group, int gfp_mask);
void cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group, int gfp_mask);

struct cb_id
{
Expand Down Expand Up @@ -71,15 +72,21 @@ void cn_del_callback(struct cb_id *id);
struct cb_id *id - unique connector's user identifier.


int cn_netlink_send(struct cn_msg *msg, u32 __groups, int gfp_mask);
int cn_netlink_send_multi(struct cn_msg *msg, u16 len, u32 portid, u32 __groups, int gfp_mask);
int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __groups, int gfp_mask);

Sends message to the specified groups. It can be safely called from
softirq context, but may silently fail under strong memory pressure.
If there are no listeners for given group -ESRCH can be returned.

struct cn_msg * - message header(with attached data).
u16 len - for *_multi multiple cn_msg messages can be sent
u32 port - destination port.
If non-zero the message will be sent to the
given port, which should be set to the
original sender.
u32 __group - destination group.
If __group is zero, then appropriate group will
If port and __group is zero, then appropriate group will
be searched through all registered connector users,
and message will be delivered to the group which was
created for user with the same ID as in msg.
Expand Down Expand Up @@ -111,7 +118,7 @@ acknowledge number MUST be the same + 1.
If we receive a message and its sequence number is not equal to one we
are expecting, then it is a new message. If we receive a message and
its sequence number is the same as one we are expecting, but its
acknowledge is not equal to the acknowledge number in the original
acknowledge is not equal to the sequence number in the original
message + 1, then it is a new message.

Obviously, the protocol header contains the above id.
Expand Down
18 changes: 18 additions & 0 deletions Documentation/devicetree/bindings/misc/arm-charlcd.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
ARM Versatile Character LCD
-----------------------------------------------------
This binding defines the character LCD interface found on ARM Versatile AB
and PB reference platforms.

Required properties:
- compatible : "arm,versatile-clcd"
- reg : Location and size of character LCD registers

Optional properties:
- interrupts - single interrupt for character LCD. The character LCD can
operate in polled mode without an interrupt.

Example:
lcd@10008000 {
compatible = "arm,versatile-lcd";
reg = <0x10008000 0x1000>;
};
2 changes: 1 addition & 1 deletion Documentation/devicetree/bindings/spmi/spmi.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Each child node must have one and only one 'reg' entry of type SPMI_USID.
reg = <...>;

#address-cells = <2>;
#size-cells <0>;
#size-cells = <0>;

child@0 {
compatible = "...";
Expand Down
2 changes: 1 addition & 1 deletion Documentation/w1/w1.generic
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ driver - (standard) symlink to the w1 driver
w1_master_add - Manually register a slave device
w1_master_attempts - the number of times a search was attempted
w1_master_max_slave_count
- the maximum slaves that may be attached to a master
- maximum number of slaves to search for at a time
w1_master_name - the name of the device (w1_bus_masterX)
w1_master_pullup - 5V strong pullup 0 enabled, 1 disabled
w1_master_remove - Manually remove a slave device
Expand Down
13 changes: 8 additions & 5 deletions Documentation/w1/w1.netlink
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Protocol.
W1_SLAVE_CMD
userspace command for slave device
(read/write/touch)
__u8 res - reserved
__u8 status - error indication from kernel
__u16 len - size of data attached to this header data
union {
__u8 id[8]; - slave unique device id
Expand All @@ -44,10 +44,14 @@ Protocol.
__u8 cmd - command opcode.
W1_CMD_READ - read command
W1_CMD_WRITE - write command
W1_CMD_TOUCH - touch command
(write and sample data back to userspace)
W1_CMD_SEARCH - search command
W1_CMD_ALARM_SEARCH - alarm search command
W1_CMD_TOUCH - touch command
(write and sample data back to userspace)
W1_CMD_RESET - send bus reset
W1_CMD_SLAVE_ADD - add slave to kernel list
W1_CMD_SLAVE_REMOVE - remove slave from kernel list
W1_CMD_LIST_SLAVES - get slaves list from kernel
__u8 res - reserved
__u16 len - length of data for this command
For read command data must be allocated like for write command
Expand Down Expand Up @@ -87,8 +91,7 @@ format:
id0 ... idN

Each message is at most 4k in size, so if number of master devices
exceeds this, it will be split into several messages,
cn.seq will be increased for each one.
exceeds this, it will be split into several messages.

W1 search and alarm search commands.
request:
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2188,6 +2188,7 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
S: Supported
F: drivers/char/*
F: drivers/misc/*
F: include/linux/miscdevice.h

CHECKPATCH
M: Andy Whitcroft <apw@canonical.com>
Expand Down
2 changes: 0 additions & 2 deletions drivers/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ obj-$(CONFIG_PCCARD) += pcmcia/
obj-$(CONFIG_DIO) += dio/
obj-$(CONFIG_SBUS) += sbus/
obj-$(CONFIG_ZORRO) += zorro/
obj-$(CONFIG_MAC) += macintosh/
obj-$(CONFIG_ATA_OVER_ETH) += block/aoe/
obj-$(CONFIG_PARIDE) += block/paride/
obj-$(CONFIG_TC) += tc/
Expand Down Expand Up @@ -141,7 +140,6 @@ obj-y += clk/

obj-$(CONFIG_MAILBOX) += mailbox/
obj-$(CONFIG_HWSPINLOCK) += hwspinlock/
obj-$(CONFIG_NFC) += nfc/
obj-$(CONFIG_IOMMU_SUPPORT) += iommu/
obj-$(CONFIG_REMOTEPROC) += remoteproc/
obj-$(CONFIG_RPMSG) += rpmsg/
Expand Down
1 change: 0 additions & 1 deletion drivers/char/applicom.c
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ static int __init applicom_init(void)
free_irq(apbs[i].irq, &dummy);
iounmap(apbs[i].RamIO);
}
pci_disable_device(dev);
return ret;
}

Expand Down
17 changes: 15 additions & 2 deletions drivers/connector/connector.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ static struct cn_dev cdev;
static int cn_already_initialized;

/*
* Sends mult (multiple) cn_msg at a time.
*
* msg->seq and msg->ack are used to determine message genealogy.
* When someone sends message it puts there locally unique sequence
* and random acknowledge numbers. Sequence number may be copied into
Expand All @@ -62,10 +64,13 @@ static int cn_already_initialized;
* the acknowledgement number in the original message + 1, then it is
* a new message.
*
* If msg->len != len, then additional cn_msg messages are expected following
* the first msg.
*
* The message is sent to, the portid if given, the group if given, both if
* both, or if both are zero then the group is looked up and sent there.
*/
int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
int cn_netlink_send_mult(struct cn_msg *msg, u16 len, u32 portid, u32 __group,
gfp_t gfp_mask)
{
struct cn_callback_entry *__cbq;
Expand Down Expand Up @@ -98,7 +103,7 @@ int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
if (!portid && !netlink_has_listeners(dev->nls, group))
return -ESRCH;

size = sizeof(*msg) + msg->len;
size = sizeof(*msg) + len;

skb = nlmsg_new(size, gfp_mask);
if (!skb)
Expand All @@ -121,6 +126,14 @@ int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
gfp_mask);
return netlink_unicast(dev->nls, skb, portid, !(gfp_mask&__GFP_WAIT));
}
EXPORT_SYMBOL_GPL(cn_netlink_send_mult);

/* same as cn_netlink_send_mult except msg->len is used for len */
int cn_netlink_send(struct cn_msg *msg, u32 portid, u32 __group,
gfp_t gfp_mask)
{
return cn_netlink_send_mult(msg, msg->len, portid, __group, gfp_mask);
}
EXPORT_SYMBOL_GPL(cn_netlink_send);

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/extcon/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ config EXTCON_ADC_JACK
Say Y here to enable extcon device driver based on ADC values.

config EXTCON_MAX14577
tristate "MAX14577 EXTCON Support"
tristate "MAX14577/77836 EXTCON Support"
depends on MFD_MAX14577
select IRQ_DOMAIN
select REGMAP_I2C
help
If you say yes here you get support for the MUIC device of
Maxim MAX14577 PMIC. The MAX14577 MUIC is a USB port accessory
Maxim MAX14577/77836. The MAX14577/77836 MUIC is a USB port accessory
detector and switch.

config EXTCON_MAX77693
Expand Down
49 changes: 20 additions & 29 deletions drivers/extcon/extcon-adc-jack.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
* @chan: iio channel being queried.
*/
struct adc_jack_data {
struct extcon_dev edev;
struct extcon_dev *edev;

const char **cable_names;
int num_cables;
Expand All @@ -64,7 +64,7 @@ static void adc_jack_handler(struct work_struct *work)

ret = iio_read_channel_raw(data->chan, &adc_val);
if (ret < 0) {
dev_err(&data->edev.dev, "read channel() error: %d\n", ret);
dev_err(&data->edev->dev, "read channel() error: %d\n", ret);
return;
}

Expand All @@ -80,7 +80,7 @@ static void adc_jack_handler(struct work_struct *work)
}
/* if no def has met, it means state = 0 (no cables attached) */

extcon_set_state(&data->edev, state);
extcon_set_state(data->edev, state);
}

static irqreturn_t adc_jack_irq_thread(int irq, void *_data)
Expand All @@ -102,33 +102,33 @@ static int adc_jack_probe(struct platform_device *pdev)
if (!data)
return -ENOMEM;

data->edev.name = pdata->name;

if (!pdata->cable_names) {
err = -EINVAL;
dev_err(&pdev->dev, "error: cable_names not defined.\n");
goto out;
return -EINVAL;
}

data->edev.dev.parent = &pdev->dev;
data->edev.supported_cable = pdata->cable_names;
data->edev = devm_extcon_dev_allocate(&pdev->dev, pdata->cable_names);
if (IS_ERR(data->edev)) {
dev_err(&pdev->dev, "failed to allocate extcon device\n");
return -ENOMEM;
}
data->edev->dev.parent = &pdev->dev;
data->edev->name = pdata->name;

/* Check the length of array and set num_cables */
for (i = 0; data->edev.supported_cable[i]; i++)
for (i = 0; data->edev->supported_cable[i]; i++)
;
if (i == 0 || i > SUPPORTED_CABLE_MAX) {
err = -EINVAL;
dev_err(&pdev->dev, "error: pdata->cable_names size = %d\n",
i - 1);
goto out;
return -EINVAL;
}
data->num_cables = i;

if (!pdata->adc_conditions ||
!pdata->adc_conditions[0].state) {
err = -EINVAL;
dev_err(&pdev->dev, "error: adc_conditions not defined.\n");
goto out;
return -EINVAL;
}
data->adc_conditions = pdata->adc_conditions;

Expand All @@ -138,42 +138,34 @@ static int adc_jack_probe(struct platform_device *pdev)
data->num_conditions = i;

data->chan = iio_channel_get(&pdev->dev, pdata->consumer_channel);
if (IS_ERR(data->chan)) {
err = PTR_ERR(data->chan);
goto out;
}
if (IS_ERR(data->chan))
return PTR_ERR(data->chan);

data->handling_delay = msecs_to_jiffies(pdata->handling_delay_ms);

INIT_DEFERRABLE_WORK(&data->handler, adc_jack_handler);

platform_set_drvdata(pdev, data);

err = extcon_dev_register(&data->edev);
err = devm_extcon_dev_register(&pdev->dev, data->edev);
if (err)
goto out;
return err;

data->irq = platform_get_irq(pdev, 0);
if (!data->irq) {
dev_err(&pdev->dev, "platform_get_irq failed\n");
err = -ENODEV;
goto err_irq;
return -ENODEV;
}

err = request_any_context_irq(data->irq, adc_jack_irq_thread,
pdata->irq_flags, pdata->name, data);

if (err < 0) {
dev_err(&pdev->dev, "error: irq %d\n", data->irq);
goto err_irq;
return err;
}

return 0;

err_irq:
extcon_dev_unregister(&data->edev);
out:
return err;
}

static int adc_jack_remove(struct platform_device *pdev)
Expand All @@ -182,7 +174,6 @@ static int adc_jack_remove(struct platform_device *pdev)

free_irq(data->irq, data);
cancel_work_sync(&data->handler.work);
extcon_dev_unregister(&data->edev);

return 0;
}
Expand Down
Loading

0 comments on commit 4046136

Please sign in to comment.