From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 41/57] x86: i2c: Add a stub driver for Intel I2C/SMbus
Date: Tue, 8 Dec 2015 06:45:36 +0100 [thread overview]
Message-ID: <56666E80.3050600@denx.de> (raw)
In-Reply-To: <1449545956-2772-42-git-send-email-sjg@chromium.org>
Hello Simon,
Am 08.12.2015 um 04:39 schrieb Simon Glass:
> This is used on most Intel platforms. We don't have a driver for it yet, but
> add a stub to handle the init. For now this targets ivybridge so we may want
> to add a device tree binding and generalise it when other platforms are
> supported.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
> drivers/i2c/Kconfig | 7 +++++++
> drivers/i2c/Makefile | 1 +
> drivers/i2c/intel_i2c.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++
> 3 files changed, 59 insertions(+)
> create mode 100644 drivers/i2c/intel_i2c.c
Reviewed-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
>
> diff --git a/drivers/i2c/Kconfig b/drivers/i2c/Kconfig
> index 14adda2..fe98557 100644
> --- a/drivers/i2c/Kconfig
> +++ b/drivers/i2c/Kconfig
> @@ -58,6 +58,13 @@ config DM_I2C_GPIO
> bindings are supported.
> Binding info: doc/device-tree-bindings/i2c/i2c-gpio.txt
>
> +config SYS_I2C_INTEL
> + bool "Intel I2C/SMBUS driver"
> + depends on DM_I2C
> + help
> + Add support for the Intel SMBUS driver. So far this driver is just
> + a stub which perhaps some basic init.
> +
> config SYS_I2C_ROCKCHIP
> bool "Rockchip I2C driver"
> depends on DM_I2C
> diff --git a/drivers/i2c/Makefile b/drivers/i2c/Makefile
> index 811ad9b..a2a956a 100644
> --- a/drivers/i2c/Makefile
> +++ b/drivers/i2c/Makefile
> @@ -21,6 +21,7 @@ obj-$(CONFIG_SYS_I2C_DW) += designware_i2c.o
> obj-$(CONFIG_SYS_I2C_FSL) += fsl_i2c.o
> obj-$(CONFIG_SYS_I2C_FTI2C010) += fti2c010.o
> obj-$(CONFIG_SYS_I2C_IHS) += ihs_i2c.o
> +obj-$(CONFIG_SYS_I2C_INTEL) += intel_i2c.o
> obj-$(CONFIG_SYS_I2C_KONA) += kona_i2c.o
> obj-$(CONFIG_SYS_I2C_LPC32XX) += lpc32xx_i2c.o
> obj-$(CONFIG_SYS_I2C_MVTWSI) += mvtwsi.o
> diff --git a/drivers/i2c/intel_i2c.c b/drivers/i2c/intel_i2c.c
> new file mode 100644
> index 0000000..1082d1a
> --- /dev/null
> +++ b/drivers/i2c/intel_i2c.c
> @@ -0,0 +1,51 @@
> +/*
> + * Copyright (c) 2015 Google, Inc
> + * Written by Simon Glass <sjg@chromium.org>
> + *
> + * SPDX-License-Identifier: GPL-2.0+
> + */
> +
> +#include <common.h>
> +#include <dm.h>
> +#include <i2c.h>
> +#include <asm/io.h>
> +
> +int intel_i2c_xfer(struct udevice *bus, struct i2c_msg *msg, int nmsgs)
> +{
> + return -ENOSYS;
> +}
> +
> +int intel_i2c_probe_chip(struct udevice *bus, uint chip_addr, uint chip_flags)
> +{
> + return -ENOSYS;
> +}
> +
> +int intel_i2c_set_bus_speed(struct udevice *bus, unsigned int speed)
> +{
> + return 0;
> +}
> +
> +static int intel_i2c_probe(struct udevice *dev)
> +{
> + return 0;
> +}
> +
> +static const struct dm_i2c_ops intel_i2c_ops = {
> + .xfer = intel_i2c_xfer,
> + .probe_chip = intel_i2c_probe_chip,
> + .set_bus_speed = intel_i2c_set_bus_speed,
> +};
> +
> +static const struct udevice_id intel_i2c_ids[] = {
> + { .compatible = "intel,ich-i2c" },
> + { }
> +};
> +
> +U_BOOT_DRIVER(intel_i2c) = {
> + .name = "i2c_intel",
> + .id = UCLASS_I2C,
> + .of_match = intel_i2c_ids,
> + .per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
> + .ops = &intel_i2c_ops,
> + .probe = intel_i2c_probe,
> +};
>
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
next prev parent reply other threads:[~2015-12-08 5:45 UTC|newest]
Thread overview: 125+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-08 3:38 [U-Boot] [PATCH 00/57] dm: x86: Convert ivybridge code to use driver model Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 01/57] dm: Add an init() method to the LPC uclass Simon Glass
2015-12-13 12:51 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 02/57] dm: core: Display the error number when driver binding fails Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 03/57] dm: usb: Add a compatible string for PCI EHCI controller Simon Glass
2015-12-08 9:15 ` Marek Vasut
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 04/57] dm: syscon: Allow finding devices by driver data Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 05/57] dm: pci: Convert bios_emu to use the driver model PCI API Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 06/57] x86: ivybridge: Set up the LPC device using driver model Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-15 18:57 ` Simon Glass
2015-12-17 10:00 ` Bin Meng
2015-12-18 2:49 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 07/57] x86: ivybridge: Move lpc_early_init() to probe() Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 08/57] x86: ivybridge: Move more init to the probe() function Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 09/57] x86: ivybridge: Set up the PCH init Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 10/57] dm: x86: Add a northbridge uclass Simon Glass
2015-12-13 12:52 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 11/57] x86: ivybridge: Add a driver for the bd82x6x northbridge Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 12/57] x86: ivybridge: Move northbridge init into the probe() method Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 13/57] x86: ivybridge: Move LPC and PCH init into northbridge probe() Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 14/57] x86: ivybridge: Rename lpc_init() to lpc_init_extra() Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 15/57] x86: ivybridge: Add an init() method for the bd82x6x LPC Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 16/57] x86: ivybridge: Move graphics init much later Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 17/57] x86: ivybridge: Move sandybridge init to the lpc init() method Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 18/57] x86: ivybridge: Move GPIO init to the LPC " Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 19/57] x86: ivybridge: Use common CPU init code Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 20/57] x86: ivybridge: Move CPU init code into the driver Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 21/57] x86: ivybridge: Set up the thermal target correctly Simon Glass
2015-12-13 12:53 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 22/57] x86: ivybridge: Drop the dead MTRR code Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 23/57] x86: ivybridge: Move early init code into northbridge.c Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 24/57] x86: Make x86_init_cpus() static Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 25/57] x86: Don't show an error when the MRC cache is up to date Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 26/57] x86: Bring up northbridge, pch and lpc after the CPUs Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 27/57] x86: ivybridge: Move northbridge and PCH init into drivers Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 28/57] x86: ivybridge: Use driver model PCI API in bd82x6x_pci_init() Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 29/57] x86: ivybridge: Use driver model PCI API in bd82x6x.c Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 30/57] x86: ivybridge: Move northbridge setup to the northbridge driver Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 31/57] ahci: Add an AHCI uclass Simon Glass
2015-12-13 12:54 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 32/57] x86: ivybridge: Do the SATA init before relocation Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 33/57] x86: ivybridge: Drop the unused bd82x6x_init_extra() Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 34/57] x86: ivybridge: Use the SATA driver to do the init Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 35/57] x86: ivybridge: Use driver model PCI API in sata.c Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 36/57] x86: ivybridge: Move lpc_enable() into gma.c Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 37/57] x86: ivybridge: Move LPC init into LPC init() method Simon Glass
2015-12-13 12:55 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 38/57] x86: ivybridge: Drop the special PCI driver Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:38 ` [U-Boot] [PATCH 39/57] x86: ivybridge: Convert lpc init code to DM PCI API Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:38 ` [U-Boot] [PATCH 40/57] x86: Enable DM_USB for link and panther Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 41/57] x86: i2c: Add a stub driver for Intel I2C/SMbus Simon Glass
2015-12-08 5:45 ` Heiko Schocher [this message]
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 42/57] x86: ivybridge: Use the I2C driver to perform SMbus init Simon Glass
2015-12-08 5:48 ` Heiko Schocher
2015-12-11 2:05 ` Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 43/57] x86: ivybridge: Convert enable_usb_bar() to use DM PCI API Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-15 18:58 ` Simon Glass
2015-12-08 3:39 ` [U-Boot] [PATCH 44/57] x86: ivybridge: Convert dram_init() " Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 45/57] x86: ivybridge: Convert sdram_initialise() " Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 46/57] x86: chromebook_link: Enable the syscon uclass Simon Glass
2015-12-13 12:56 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 47/57] x86: ivybridge: Convert SDRAM init to use driver model Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 48/57] x86: ivybridge: Convert report_platform to DM PCI API Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 49/57] x86: ivybridge: Convert pch.c to use " Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 50/57] x86: ivybridge: Move code from pch.c to bd82x6x.c Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 51/57] x86: ivybridge: Sort out the calls to bridge_silicon_revision() Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 52/57] x86: ivybridge: Convert EHCI init to use the DM PCI API Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 53/57] x86: ivybridge: Drop XHCI support Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 54/57] x86: ivybridge: Drop the SMM-locking code Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 55/57] x86: Set up a shared syscon numbering schema Simon Glass
2015-12-13 12:57 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 56/57] x86: ivybridge: Use syscon for the GMA device Simon Glass
2015-12-13 12:58 ` Bin Meng
2015-12-08 3:39 ` [U-Boot] [PATCH 57/57] x86: fdt: Drop the unused compatible strings in fdtdec Simon Glass
2015-12-13 12:58 ` Bin Meng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56666E80.3050600@denx.de \
--to=hs@denx.de \
--cc=u-boot@lists.denx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox