Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp6609136ybe; Wed, 18 Sep 2019 06:20:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqy071n+llqul1/u0Hbia5KBsFgptpI73pHc6H1TMNSIlYfdvzUHpghjmLu3ItSNZTUy/c// X-Received: by 2002:a50:e791:: with SMTP id b17mr1210518edn.11.1568812857361; Wed, 18 Sep 2019 06:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568812857; cv=none; d=google.com; s=arc-20160816; b=yeYSrfxcBvIjAXiNGu0WUmevkFmQa1GXKjPfwIxMXY6isAn0LSAyTexyd4Q62xUKhh va1BOrIpsnx09vUsuzFlWjuD2cH6EvM2sxOWpHUA3/g/uUQ4ehdfLdTGrxmqE7uIDrIU Yf6oUEUt1qkwwShfhAGyE1zWIHxueRc5+eVivSuA52dcM7RhPy8fRkOPQdBewa0ZSLV1 IAOTIMHI8AO/FbpWx2itntKyif1d8BpLGf0cwbHgUpLQZ6Osg+HPy0Zw6pNwrue+BqWi O9RJll/EQP2uMWlMavGOSlp39rqpskJViqIKnDF1+ksc0qc8qaG8zqj/Y1ffXdLiL5DT bcnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=8xGyacSjSI79wvxydAPMNQhz2XUtmEOpWuQK2TP5Jcw=; b=JXxdF5a8OkJqcCk0RSrmHV5P40ENior6+LCs1PNehEyWPWX7DMB+Fwi8mFOvnn1nKE HZoYgBzMGxA6AGd0ZVuyB/g/3Q0+40zd8MQh4eJ6LBofsphhuV8EXUqaBRlaYvjAZDCL B5gsEPD6owIHr2hbBK4ztakFJVzYLMqwqxeeD5Spb38c2NXAbGHaBLik05aFB18D4pfG EWZBlBGDA9nixbx1emywlb+ZKag8ZLQvLHZexgG0ZScx7flYz9FWWo9C7tLoG59dW0s1 i4yYZjAvhG9OB8WoSEPrmSFJ/U+OcaezpIjbGtRvFn2qNyondd1Vu1J7BmWhUvdWB+RY QF4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoiNHZHr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o11si2749687ejj.127.2019.09.18.06.20.33; Wed, 18 Sep 2019 06:20:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KoiNHZHr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730149AbfIRLmZ (ORCPT + 99 others); Wed, 18 Sep 2019 07:42:25 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35130 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727598AbfIRLmZ (ORCPT ); Wed, 18 Sep 2019 07:42:25 -0400 Received: by mail-wr1-f67.google.com with SMTP id v8so6586775wrt.2; Wed, 18 Sep 2019 04:42:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=8xGyacSjSI79wvxydAPMNQhz2XUtmEOpWuQK2TP5Jcw=; b=KoiNHZHrla/1XxwQAUT8bteHDmTHzbt9AV2nGb2Fy1zxytwetrAT4Ll9qfpeNpTp0J 1jBL8Gnnd9By2c7croJ5oAJQevcdHPooLZDMSF2qnMKIxza+V+0OnyDJo77h3jZ/cZY5 z5LElMhqpFnzuJ4CU3Gp9S2ogVPc/QyYwUrl4M/3vg8woVoY+16Cb9P/V7BsiPXklo6s z+UMu3lfHD9yXghF/wkcXHtE09+EEX19iUGCT6B9hrdp5KbUZ2Vm0IkoVsi2RCrw9bxB L+Wj6pnp2EEc78n3Eo0CBWLUJHsJsiRXFpRy1eQNiIN6cIcwTnd6gNXchlWbGxtQX4hE CfBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=8xGyacSjSI79wvxydAPMNQhz2XUtmEOpWuQK2TP5Jcw=; b=FJtonkFzkNJVj5e09ZeLKhGrNZTRAWrBU4vMkLrvjhJLiCInpay+Pl+24pO4eAXLcr TvP0+YdK6SPMhC3QwO1Z04g8qLyaENELYZuh+5m4HIf+PQ+GrwREy8cE6+c7aqhq2Vjt lILhRmsAslDqvn3fNRGAuq/EH1uc0nEL7Z+NUjqhm29bZ8iiC+en5mfMTY1Qcy8KcdyW yFYe29v3G2J/UaIh8lrEuTXaL6LqknppFWrk/SnwFUTCJpMMbrb38Qe37x9mybr8AQVl gYYU5xvo1tlocOswWj2MWQCiMPU1xUBmvIHdPxdECtkKj/u/jveRU3RRfFWMTPRmeZVT wK/g== X-Gm-Message-State: APjAAAXtQATFgB1Rq6iQjFsnKvWYOfEmgHKi5SBTgIF6gqOS5EsYNYtl +y/S5Eer8OP+XyS0WwPY2Kg= X-Received: by 2002:adf:df81:: with SMTP id z1mr2845467wrl.295.1568806942580; Wed, 18 Sep 2019 04:42:22 -0700 (PDT) Received: from localhost.localdomain (dynamic-vpdn-93-125-15-224.telecom.by. [93.125.15.224]) by smtp.gmail.com with ESMTPSA id y3sm6166881wmg.2.2019.09.18.04.42.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Sep 2019 04:42:22 -0700 (PDT) Received: from [127.0.0.1] (helo=jeknote.loshitsa1.net) by localhost.localdomain with esmtp (Exim 4.92.1) (envelope-from ) id 1iAYLo-0007WY-CJ; Wed, 18 Sep 2019 14:42:24 +0300 Date: Wed, 18 Sep 2019 14:42:24 +0300 From: Yauhen Kharuzhy To: Hans de Goede Cc: Darren Hart , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: Re: [PATCH v2 1/1] platform/x86/intel_cht_int33fe: Split code to USB TypeB and TypeC variants Message-ID: <20190918114224.GA23318@jeknote.loshitsa1.net> References: <20190917194507.14771-1-jekhor@gmail.com> <20190917194507.14771-2-jekhor@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 18, 2019 at 11:20:21AM +0200, Hans de Goede wrote: > Hi, > > On 17-09-2019 21:45, Yauhen Kharuzhy wrote: > > Existing intel_cht_int33fe ACPI pseudo-device driver assumes that > > hardware has TypeC connector and register related devices described as > > I2C connections in the _CRS resource. > > > > There is at least one hardware (Lenovo Yoga Book YB1-91L/F) with micro > > USB B connector exists. It has INT33FE device in the DSDT table but > > there are only two I2C connection described: PMIC and BQ27452 battery > > fuel gauge. > > > > Splitting existing INT33FE driver allow to maintain code for USB type B > > (AB) connector variant separately and make it simpler. > > > > Split driver to intel_cht_int33fe_common.c and > > intel_cht_int33fe_{typeb,typec}.c. Compile all this source to one .ko > > module to make user experience easier. > > > > Signed-off-by: Yauhen Kharuzhy > > Thank you for doing this, this version looks much better IMHO. > > Note that this does not apply to Linus' current master, please > rebase. Specifically this conflicts with this patch: > > https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=78cd4bf53635d3aeb73435bc89eb6eb39450f315 > > Which just got merged. Instead of rebasing on Linus' master > (which is always a bit adventurous to use during the merge window) > you can also cherry-pick that single commit on top of v5.3 > and use that as a base. > > Note that that patch makes changes to struct cht_int33fe_data > specifically it drops the: > > struct fwnode_handle *mux; > > Member, so when rebasing you should drop that in the new > version of the struct on common.h . > > Besides that this need a rebase, overall this looks good, I have some > small remarks inline: Arghh.. OK, I have rebased the patch but at current torvalds kernel i2c_acpi_new_device() fails with -EPROBE_DEFER at my hw, so I cannot check if it is fully working. But I will resend patch anyway soon, this error should not be related to the patch content. > > + data->hw_type = ret; > > + data->dev = dev; > > + > > + switch (data->hw_type) { > > I suggested adding hw_type to data so that it could be used to > select the right remove function in cht_int33fe_remove(), > since you are using a remove function pointer in data for this > (which is fine), there is no reason to store hw_type in > cht_int33fe_data anymore, please drop this and change the > > switch (data->hw_type) { > > to: > > switch (ret) { OK, sure > > p.s. > > I've done the rebase myself and I'm building a kernel with my re-based version of this > patch to test it on a typec device. I will get back to you with the results > (I expect things will just work, just making sure). > -- Yauhen Kharuzhy