Commit 5b744981 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'tag-chrome-platform-for-v4.20' of...

Merge tag 'tag-chrome-platform-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform

Pull chrome-platform updates from Benson Leung:

 - Move mfd/cros_ec_lpc* includes to drivers/platform from mfd

 - Adding a new interrupt path for cros_ec_lpc

* tag 'tag-chrome-platform-for-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/bleung/chrome-platform:
  platform/chrome: chromeos_tbmc - Remove unneeded const
  platform/chrome: Add a new interrupt path for cros_ec_lpc
  mfd: cros_ec: Fix and improve kerneldoc comments.
  platform/chrome: Move mfd/cros_ec_lpc* includes to drivers/platform.
parents 3dca04d6 bc3f4b5c
......@@ -26,12 +26,13 @@
#define CROS_EC_DEV_VERSION "1.0.0"
/*
* @offset: within EC_LPC_ADDR_MEMMAP region
* @bytes: number of bytes to read. zero means "read a string" (including '\0')
* (at most only EC_MEMMAP_SIZE bytes can be read)
* @buffer: where to store the result
* ioctl returns the number of bytes read, negative on error
/**
* struct cros_ec_readmem - Struct used to read mapped memory.
* @offset: Within EC_LPC_ADDR_MEMMAP region.
* @bytes: Number of bytes to read. Zero means "read a string" (including '\0')
* At most only EC_MEMMAP_SIZE bytes can be read.
* @buffer: Where to store the result. The ioctl returns the number of bytes
* read or negative on error.
*/
struct cros_ec_readmem {
uint32_t offset;
......
......@@ -99,7 +99,7 @@ static const struct acpi_device_id chromeos_tbmc_acpi_device_ids[] = {
};
MODULE_DEVICE_TABLE(acpi, chromeos_tbmc_acpi_device_ids);
static const SIMPLE_DEV_PM_OPS(chromeos_tbmc_pm_ops, NULL,
static SIMPLE_DEV_PM_OPS(chromeos_tbmc_pm_ops, NULL,
chromeos_tbmc_resume);
static struct acpi_driver chromeos_tbmc_driver = {
......
......@@ -25,14 +25,16 @@
#include <linux/dmi.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/interrupt.h>
#include <linux/mfd/cros_ec.h>
#include <linux/mfd/cros_ec_commands.h>
#include <linux/mfd/cros_ec_lpc_reg.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/printk.h>
#include <linux/suspend.h>
#include "cros_ec_lpc_reg.h"
#define DRV_NAME "cros_ec_lpcs"
#define ACPI_DRV_NAME "GOOG0004"
......@@ -248,7 +250,7 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)
acpi_status status;
struct cros_ec_device *ec_dev;
u8 buf[2];
int ret;
int irq, ret;
if (!devm_request_region(dev, EC_LPC_ADDR_MEMMAP, EC_MEMMAP_SIZE,
dev_name(dev))) {
......@@ -287,6 +289,18 @@ static int cros_ec_lpc_probe(struct platform_device *pdev)
sizeof(struct ec_response_get_protocol_info);
ec_dev->dout_size = sizeof(struct ec_host_request);
/*
* Some boards do not have an IRQ allotted for cros_ec_lpc,
* which makes ENXIO an expected (and safe) scenario.
*/
irq = platform_get_irq(pdev, 0);
if (irq > 0)
ec_dev->irq = irq;
else if (irq != -ENXIO) {
dev_err(dev, "couldn't retrieve IRQ number (%d)\n", irq);
return irq;
}
ret = cros_ec_register(ec_dev);
if (ret) {
dev_err(dev, "couldn't register ec_dev (%d)\n", ret);
......
......@@ -24,10 +24,11 @@
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/mfd/cros_ec_commands.h>
#include <linux/mfd/cros_ec_lpc_mec.h>
#include <linux/mutex.h>
#include <linux/types.h>
#include "cros_ec_lpc_mec.h"
/*
* This mutex must be held while accessing the EMI unit. We can't rely on the
* EC mutex because memmap data may be accessed without it being held.
......
......@@ -21,8 +21,8 @@
* expensive.
*/
#ifndef __LINUX_MFD_CROS_EC_MEC_H
#define __LINUX_MFD_CROS_EC_MEC_H
#ifndef __CROS_EC_LPC_MEC_H
#define __CROS_EC_LPC_MEC_H
#include <linux/mfd/cros_ec_commands.h>
......@@ -87,4 +87,4 @@ void cros_ec_lpc_mec_destroy(void);
u8 cros_ec_lpc_io_bytes_mec(enum cros_ec_lpc_mec_io_type io_type,
unsigned int offset, unsigned int length, u8 *buf);
#endif /* __LINUX_MFD_CROS_EC_MEC_H */
#endif /* __CROS_EC_LPC_MEC_H */
......@@ -24,7 +24,8 @@
#include <linux/io.h>
#include <linux/mfd/cros_ec.h>
#include <linux/mfd/cros_ec_commands.h>
#include <linux/mfd/cros_ec_lpc_mec.h>
#include "cros_ec_lpc_mec.h"
static u8 lpc_read_bytes(unsigned int offset, unsigned int length, u8 *dest)
{
......
......@@ -21,8 +21,8 @@
* expensive.
*/
#ifndef __LINUX_MFD_CROS_EC_REG_H
#define __LINUX_MFD_CROS_EC_REG_H
#ifndef __CROS_EC_LPC_REG_H
#define __CROS_EC_LPC_REG_H
/**
* cros_ec_lpc_read_bytes - Read bytes from a given LPC-mapped address.
......@@ -58,4 +58,4 @@ void cros_ec_lpc_reg_init(void);
*/
void cros_ec_lpc_reg_destroy(void);
#endif /* __LINUX_MFD_CROS_EC_REG_H */
#endif /* __CROS_EC_LPC_REG_H */
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment