Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933885AbbLPO2T (ORCPT ); Wed, 16 Dec 2015 09:28:19 -0500 Received: from mga11.intel.com ([192.55.52.93]:13532 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753728AbbLPO2R (ORCPT ); Wed, 16 Dec 2015 09:28:17 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,437,1444719600"; d="scan'208";a="874919183" Date: Wed, 16 Dec 2015 16:28:10 +0200 From: Mika Westerberg To: Suravee Suthikulpanit Cc: wsa@the-dreams.de, lho@apm.com, Ken.Xue@amd.com, linux-i2c@vger.kernel.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, Jarkko Nikula , Andy Shevchenko Subject: Re: [PATCH] i2c: designware: Do not require clock when SSCN and FFCN are provided Message-ID: <20151216142810.GW1762@lahna.fi.intel.com> References: <1450219138-5868-1-git-send-email-Suravee.Suthikulpanit@amd.com> <20151216094202.GR1762@lahna.fi.intel.com> <56717100.3020602@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56717100.3020602@amd.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1421 Lines: 32 On Wed, Dec 16, 2015 at 08:11:12AM -0600, Suravee Suthikulpanit wrote: > >The clk framework should work fine if the returned clock is NULL (which > >I think is your case). > > > >The driver gates clocks when the device is suspended and on Intel LPSS > >there actually is a clock that gets gated. > > > >>[..] > >>@@ -203,13 +223,11 @@ static int dw_i2c_plat_probe(struct platform_device *pdev) > >> dev->master_cfg = DW_IC_CON_MASTER | DW_IC_CON_SLAVE_DISABLE | > >> DW_IC_CON_RESTART_EN | DW_IC_CON_SPEED_FAST; > >> > >>- dev->clk = devm_clk_get(&pdev->dev, NULL); > >>- dev->get_clk_rate_khz = i2c_dw_get_clk_rate_khz; > >>- if (IS_ERR(dev->clk)) > >>- return PTR_ERR(dev->clk); > > Actually, if we don't provide the clock (which is the case for ACPI), this > would also return and cause the probing to fail. Indeed it seems that when you have CONFIG_COMMON_CLK selected the clock framework starts returning errors if the clock is not found. Since we need the clock for Intel LPSS I2C host controllers (and they may have *CNT methods), I think you just need to provide the clock for AMD I2C host controller in similar way than we do in drivers/acpi/acpi_lpss.c. -- 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/