Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752782AbbETHrR (ORCPT ); Wed, 20 May 2015 03:47:17 -0400 Received: from mga02.intel.com ([134.134.136.20]:5166 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752163AbbETHrN (ORCPT ); Wed, 20 May 2015 03:47:13 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,463,1427785200"; d="scan'208";a="728854090" Date: Wed, 20 May 2015 10:47:08 +0300 From: Mika Westerberg To: Robert Dolca Cc: linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Wolfram Sang , "Rafael J. Wysocki" , Len Brown , Daniel Baluta Subject: Re: [PATCH RFC] i2c: Use ID table to detect ACPI I2C devices Message-ID: <20150520074708.GQ1490@lahna.fi.intel.com> References: <1432044209-27858-1-git-send-email-robert.dolca@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1432044209-27858-1-git-send-email-robert.dolca@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1740 Lines: 36 On Tue, May 19, 2015 at 05:03:29PM +0300, Robert Dolca wrote: > For i2c devices enumerated with ACPI you need to declare both > acpi_match_table and id_table. When using ACPI, the i2c_device_id structure > supplied to the probe function is null and you have to handle this case > in the driver. > > The current name for the i2c client when using ACPI is "HID:UID" where the > UID has 7 or 8 characters and the UID has 2 characters. The UID is not > relevant for identifying the chip so it does not have any practical > purpose. First of all, it is not "HID:UID" since the number after ":" is actually increasing number assigned by the ACPI core. Nothing to do with _UID. Secondly we do not list "_HID:nn" in drivers acpi_match_tables but instead it is either "HID" or "CID", no ":nn" there. > Modifying i2c_match_id we make the comparison by ignoring the UID from the > client name when the device was discovered using ACPI. The comparison is > case insensitive because the ACPI names are uppercase and the DT and ID > table names are lowercase. It would not make sense to have two different > chips with the same name and the only diference being the capitalized > letters. > > With these changes the probe function gets a valid i2c_device_id and the > driver doesn't have to declare acpi_match_table. No. We don't do that for DT and we definitely don't want to mix ACPI identifiers with arbitrary I2C device names. You are not supposed to put ACPI identifiers into i2c_device_id table. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/