Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp349530img; Tue, 26 Feb 2019 00:53:27 -0800 (PST) X-Google-Smtp-Source: AHgI3IY4YjdL3WvArN5dlC3YcwEIlXE0YZSFrAJBSS05Wi9lO2epk/thuo1JsilNVKCEBZjcloWE X-Received: by 2002:a17:902:7242:: with SMTP id c2mr24565146pll.245.1551171207502; Tue, 26 Feb 2019 00:53:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551171207; cv=none; d=google.com; s=arc-20160816; b=0bLULYU2i9oMeIB7W/3bZuXGsONX+4HJdR/wi0vj1iP7NrUbjx8zjjB+gpkTNjIFfo GWf68CNpPNkr/Shp6vAAhLRGOmz5XWdSs9RRLDAdD04oA44zTCTRQx6z1SSAixVWlix9 B5yGGQwdh+2O7Zq3+TUzI+jZB3y8j77ikAPVFs4vfXRhH8Fotw/72Opzvbe36xzCXLud xTBHbbn8Pji/Ke0nGbqpv1kAiszzW3DBUDzaMFBCRcJK9Sr90FuWTlxr9Cm0Jwv1EyOq 0RanDuSVqpnJ7hk6wbAh9invbx8qpBSpWIsmToHeXP8wu3xz7e43mD56p5Kv5WdXswnE BpQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=/WnM3fhltZfMoWZpiraAltnifLQ+ixrToLJy8yoDPyo=; b=1KCcXYkuNJ3ITPOwxvK/2CUMaLPPaXfs1nbcCYTd5RwPs8S9fvAa24Udq0Dj+/+ixq 6EQRPUDSidcoeNYnGvV1E88+NhZoWGRASWg587zPKPXFBGD7abWtoGRpbiyVfavO6pLv AOORD87kTWx2LnfvfpgkxHM5gm8OHm79dkl/racwkafriUeOAZCKwKfzOpjRgJjayM// iuEpql1NCs8NOqXwjcg71pVop3quYiC2NSupzpF+2X4vLzinCYK+waMu0Pwrm+mOyQGy oBfpt0+i1w8SjHfDum0jxjgRnSkwuMrMjtGYJzm16K4TRdLMFA2/4fXqus+pCStdbYEP KOIw== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v4si11710509pfm.7.2019.02.26.00.53.12; Tue, 26 Feb 2019 00:53:27 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727260AbfBZIvf (ORCPT + 99 others); Tue, 26 Feb 2019 03:51:35 -0500 Received: from mga14.intel.com ([192.55.52.115]:40543 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725977AbfBZIve (ORCPT ); Tue, 26 Feb 2019 03:51:34 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Feb 2019 00:51:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,414,1544515200"; d="scan'208";a="277917876" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga004.jf.intel.com with ESMTP; 26 Feb 2019 00:51:30 -0800 Received: from andy by smile with local (Exim 4.92-RC6) (envelope-from ) id 1gyYSX-0005fZ-3R; Tue, 26 Feb 2019 10:51:29 +0200 Date: Tue, 26 Feb 2019 10:51:29 +0200 From: Andy Shevchenko To: "Life is hard, and then you die" Cc: Dmitry Torokhov , Henrik Rydberg , Lukas Wunner , Federico Lorenzi , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/2] Input: add Apple SPI keyboard and trackpad driver. Message-ID: <20190226085129.GU9224@smile.fi.intel.com> References: <20190221105609.5710-1-ronald@innovation.ch> <20190221105609.5710-3-ronald@innovation.ch> <20190225080529.GA26142@innovation.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190225080529.GA26142@innovation.ch> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 25, 2019 at 12:05:29AM -0800, Life is hard, and then you die wrote: > > On Thu, Feb 21, 2019 at 02:56:09AM -0800, Ronald Tschal?r wrote: > > The keyboard and trackpad on recent MacBook's (since 8,1) and > > MacBookPro's (13,* and 14,*) are attached to an SPI controller instead > > of USB, as previously. The higher level protocol is not publicly > > documented and hence has been reverse engineered. As a consequence there > > are still a number of unknown fields and commands. However, the known > > parts have been working well and received extensive testing and use. > > > > In order for this driver to work, the proper SPI drivers need to be > > loaded too; for MB8,1 these are spi_pxa2xx_platform and spi_pxa2xx_pci; > > for all others they are spi_pxa2xx_platform and intel_lpss_pci. For this > > reason enabling this driver in the config implies enabling the above > > drivers. > > +/** > > + * This is a reduced version of print_hex_dump() that uses dev_printk(). > > + */ ...and this should follow kernel doc as stated by comment style. > > +static void dev_print_hex_dump(const char *level, const struct device *dev, > > + const char *prefix_str, > > + int rowsize, int groupsize, > > + const void *buf, size_t len, bool ascii) > > +{ > > + const u8 *ptr = buf; > > + int i, linelen, remaining = len; > > + unsigned char linebuf[32 * 3 + 2 + 32 + 1]; > > + > > + if (rowsize != 16 && rowsize != 32) > > + rowsize = 16; > > + > > + for (i = 0; i < len; i += rowsize) { > > + linelen = min(remaining, rowsize); > > + remaining -= rowsize; > > + > > + hex_dump_to_buffer(ptr + i, linelen, rowsize, groupsize, > > + linebuf, sizeof(linebuf), ascii); > > + > > + dev_printk(level, dev, "%s%s\n", prefix_str, linebuf); > > + } > > +} > > Apologies, I should've have fixed this before posting v2: I'll > introduce an additional patch to add this function to the core to > avoid duplication and because I presume this may be useful for others > too. Yes, makes sense. -- With Best Regards, Andy Shevchenko