mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Benson Leung <bleung@chromium.org>
To: matthew.garrett@nebula.com, platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: olofj@chromium.org, miletus@chromium.org,
	Benson Leung <bleung@chromium.org>
Subject: [PATCH 2/6] Platform: x86: chromeos_laptop - Add a more general add_i2c_device
Date: Thu, 21 Feb 2013 12:14:56 -0800	[thread overview]
Message-ID: <1361477700-26342-3-git-send-email-bleung@chromium.org> (raw)
In-Reply-To: <1361477700-26342-1-git-send-email-bleung@chromium.org>

This will allow us to assign devices to buses by the type enum.

Signed-off-by: Benson Leung <bleung@chromium.org>
---
 drivers/platform/x86/chromeos_laptop.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/platform/x86/chromeos_laptop.c b/drivers/platform/x86/chromeos_laptop.c
index d223592..d585548 100644
--- a/drivers/platform/x86/chromeos_laptop.c
+++ b/drivers/platform/x86/chromeos_laptop.c
@@ -148,16 +148,24 @@ static int __init find_i2c_adapter_num(enum i2c_adapter_type type)
  * info->addr.
  * Returns NULL if no device found.
  */
-static struct i2c_client __init *add_smbus_device(const char *name,
-						  struct i2c_board_info *info)
+static __init struct i2c_client *add_i2c_device(const char *name,
+						enum i2c_adapter_type type,
+						struct i2c_board_info *info)
 {
 	const unsigned short addr_list[] = { info->addr, I2C_CLIENT_END };
 	return __add_probed_i2c_device(name,
-				       find_i2c_adapter_num(I2C_ADAPTER_SMBUS),
+				       find_i2c_adapter_num(type),
 				       info,
 				       addr_list);
 }
 
+
+static struct i2c_client __init *add_smbus_device(const char *name,
+						  struct i2c_board_info *info)
+{
+	return add_i2c_device(name, I2C_ADAPTER_SMBUS, info);
+}
+
 static int __init setup_cyapa_smbus_tp(const struct dmi_system_id *id)
 {
 	/* add cyapa touchpad on smbus */
-- 
1.8.1.3


  parent reply	other threads:[~2013-02-21 20:15 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-21 20:14 [PATCH 0/6] Platform: x86: chromeos_laptop - Add support for Chromebook Pixel Benson Leung
2013-02-21 20:14 ` [PATCH 1/6] Platform: x86: chromeos_laptop - add i915 gmbuses to adapter names Benson Leung
2013-02-21 21:43   ` Matthew Garrett
2013-02-21 20:14 ` Benson Leung [this message]
2013-02-21 20:14 ` [PATCH 3/6] Platform: x86: chromeos_laptop - Add isl light sensor for Pixel Benson Leung
2013-02-21 20:14 ` [PATCH 4/6] Platform: x86: chromeos_laptop - Add support for probing devices Benson Leung
2013-02-21 20:14 ` [PATCH 5/6] Platform: x86: chromeos_laptop - Add Pixel Trackpad Benson Leung
2013-02-21 20:15 ` [PATCH 6/6] Platform: x86: chromeos_laptop - Add Pixel Touchscreen Benson Leung

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=1361477700-26342-3-git-send-email-bleung@chromium.org \
    --to=bleung@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=matthew.garrett@nebula.com \
    --cc=miletus@chromium.org \
    --cc=olofj@chromium.org \
    --cc=platform-driver-x86@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®