Received: by 10.223.164.221 with SMTP id h29csp40634wrb; Tue, 31 Oct 2017 13:28:58 -0700 (PDT) X-Google-Smtp-Source: ABhQp+RhQw0cPULM1u2L3I9EdkPCFkvpkXSbbn1qjE3c9qbcxyWI8nfIBdjJu4MZtTTV3+b3zMC0 X-Received: by 10.98.200.138 with SMTP id i10mr3348860pfk.222.1509481738411; Tue, 31 Oct 2017 13:28:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509481738; cv=none; d=google.com; s=arc-20160816; b=Gs9Wfw3Kcy4E8H049XLlPpNnAVlLeoAAPpyWlC83HpGN9hTq4OJbZdIiwcmrWrMPrX Zf4ihhP6g1ASgXd+dg8uAYBf48PapPveMd6b9EdQrIl2TDsQZcHapU5ZEZj7eGAj722o ch5hvSfn/iAmgGC9dUm+2IxikUM66FgEHYyZFhmxPNxwdxEnloOzmaZxyoi4lx/8UCgW yvlos2xzZsJabV1ruew4msNO2lM8QVBezoRXzJL2fE8yhzDi363hG6R0H1EfHoT3Le1c LTiDop3cR20HS59s2QOZSePzHLUvYCWLhaKfrnsQ6+5oWKXX1ePm1Cd/YVp0cbx3orWk POpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=rNgzrqOyMRIwzCJ6+isenp7T7D0C0CoroMSrxEuA5RA=; b=bNFUg4qlX1Uk+pWByz3sEsyQPBd95bq7sw0CNnSXx5fzgN+LYKiAM01cifOn1ZZvsr QXJSqJk2Z6soHGtOSUYHQx3hLneACztONs2QRWORdnCfJ1CBu4nO1aDrteM7GxdMr7k3 q9TJRlZUGvS1hCIObvh2elhSrmjUN0kD2hvhtKvx0KHxW7QlrYw0J5GJ+xFhCa/J3GuD 3KJytvsStS+T/MeHGTDzG1qhVoAZPysCo37Ansy74jYoSd66mElWBe3NwGAohSh61vRy 9uAYgyds1MQl1GTmuMNB1G0WcDIE/RpYInMcFwVa8RBJRIiRQQi75VFIDmpS4mfo0gGM jrpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@apm.com header.s=apm header.b=cfPdtFNS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=apm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b187si2498996pfg.335.2017.10.31.13.28.41; Tue, 31 Oct 2017 13:28:58 -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=@apm.com header.s=apm header.b=cfPdtFNS; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=apm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932724AbdJaU1z (ORCPT + 99 others); Tue, 31 Oct 2017 16:27:55 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:56614 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752066AbdJaU1x (ORCPT ); Tue, 31 Oct 2017 16:27:53 -0400 Received: by mail-oi0-f67.google.com with SMTP id v9so357976oif.13 for ; Tue, 31 Oct 2017 13:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=apm.com; s=apm; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rNgzrqOyMRIwzCJ6+isenp7T7D0C0CoroMSrxEuA5RA=; b=cfPdtFNSJRl9boFLE81TGT1Ak1KkJlwbjbe+RyQ954AM2MUHpOyRDazZDPT5cW5k0j Ymb4Rjz2PzQWWHEQt6xKp9zVj5bo6WGDPAP0QNreqgnXKbUpt/xHvueiE1hsKilRfVTq +7R7e2MMDOdZ4V+VjPI0fCXi1HPIJGlDaW7jo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=rNgzrqOyMRIwzCJ6+isenp7T7D0C0CoroMSrxEuA5RA=; b=R9L2VMDaC6BKBgCvTrbEII9ok4AJtbueDnnjTto6REkEKYvFT3uqltxy0cmWjKMsIf I1z/4K34X8UQRaPDUpIJsTn3cv9KmsMgNcRPNrKOdFxhUM8mN8J1+jFB4BPves/N3DEv 4NM7AjNx6VC0UJrB2QdAJvqJieW1REvpWrYW5cxOJPV10izZ7CRsYZDS+HtuBgN0pKoz MSJ8I3eNy5Px36t36HlYaAi2rs35s5GIqJ9VrJIF8WIG9XZzNYKsvDrFwiSB5UOR/aBB ZT99Ig47w8ydJ5zX+XW7iiyZAyIAzMSs38Lo2Xz5mOt+eiR1QPMaLZvg+fHfrpycU5+4 GDyw== X-Gm-Message-State: AMCzsaVG06LzEpt2NnC/Sn3/tL0UxDfsHP15o8blJqROoraLrKKzPtUx SlHgbtpv51O9fDKkUxPh6rpVX0RGOglTK3xakpPHm0xrb6k= X-Received: by 10.202.78.216 with SMTP id c207mr1615887oib.242.1509481672823; Tue, 31 Oct 2017 13:27:52 -0700 (PDT) MIME-Version: 1.0 Received: by 10.74.55.70 with HTTP; Tue, 31 Oct 2017 13:27:52 -0700 (PDT) In-Reply-To: <1509441294.10233.81.camel@linux.intel.com> References: <1509402256-3357-1-git-send-email-hotran@apm.com> <1509441294.10233.81.camel@linux.intel.com> From: Hoan Tran Date: Tue, 31 Oct 2017 13:27:52 -0700 Message-ID: Subject: Re: [PATCH v2] i2c: xgene-slimpro: Support v2 To: Andy Shevchenko Cc: Wolfram Sang , linux-i2c@vger.kernel.org, lkml , Loc Ho , patches Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andy, On Tue, Oct 31, 2017 at 2:14 AM, Andy Shevchenko wrote: > On Mon, 2017-10-30 at 15:24 -0700, Hoan Tran wrote: >> This patch supports xgene-slimpro-i2c v2 which uses the non-cachable >> memory >> as the PCC shared memory. >> > > Reviewed-by: Andy Shevchenko > > (I'm totally fine with ACPI bits here, for the rest I hope it had been > tested and works as expected) Yes, it had been tested. Thanks Hoan > >> Signed-off-by: Hoan Tran >> --- >> v2: >> - Remove un-necessary ifdef CONFIG_ACPI >> - Use acpi_match_table pointer from pdev >> - Use MEMREMAP_WT for non-cachable memory >> >> drivers/i2c/busses/i2c-xgene-slimpro.c | 30 >> ++++++++++++++++++++++++++---- >> 1 file changed, 26 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/i2c/busses/i2c-xgene-slimpro.c >> b/drivers/i2c/busses/i2c-xgene-slimpro.c >> index 7e89ba6..a7ac746 100644 >> --- a/drivers/i2c/busses/i2c-xgene-slimpro.c >> +++ b/drivers/i2c/busses/i2c-xgene-slimpro.c >> @@ -129,6 +129,11 @@ struct slimpro_i2c_dev { >> #define to_slimpro_i2c_dev(cl) \ >> container_of(cl, struct slimpro_i2c_dev, mbox_client) >> >> +enum slimpro_i2c_version { >> + XGENE_SLIMPRO_I2C_V1 = 0, >> + XGENE_SLIMPRO_I2C_V2 = 1, >> +}; >> + >> /* >> * This function tests and clears a bitmask then returns its old >> value >> */ >> @@ -476,6 +481,15 @@ static int xgene_slimpro_i2c_probe(struct >> platform_device *pdev) >> } >> } else { >> struct acpi_pcct_hw_reduced *cppc_ss; >> + const struct acpi_device_id *acpi_id; >> + int version = XGENE_SLIMPRO_I2C_V1; >> + >> + acpi_id = acpi_match_device(pdev->dev.driver- >> >acpi_match_table, >> + &pdev->dev); >> + if (!acpi_id) >> + return -EINVAL; >> + >> + version = (int)acpi_id->driver_data; >> >> if (device_property_read_u32(&pdev->dev, "pcc- >> channel", >> &ctx->mbox_idx)) >> @@ -514,9 +528,16 @@ static int xgene_slimpro_i2c_probe(struct >> platform_device *pdev) >> */ >> ctx->comm_base_addr = cppc_ss->base_address; >> if (ctx->comm_base_addr) { >> - ctx->pcc_comm_addr = memremap(ctx- >> >comm_base_addr, >> - cppc_ss- >> >length, >> - MEMREMAP_WB); >> + if (version == XGENE_SLIMPRO_I2C_V2) >> + ctx->pcc_comm_addr = memremap( >> + ctx- >> >comm_base_addr, >> + cppc_ss- >> >length, >> + MEMREMAP_WT); >> + else >> + ctx->pcc_comm_addr = memremap( >> + ctx- >> >comm_base_addr, >> + cppc_ss- >> >length, >> + MEMREMAP_WB); >> } else { >> dev_err(&pdev->dev, "Failed to get PCC comm >> region\n"); >> rc = -ENOENT; >> @@ -581,7 +602,8 @@ MODULE_DEVICE_TABLE(of, xgene_slimpro_i2c_dt_ids); >> >> #ifdef CONFIG_ACPI >> static const struct acpi_device_id xgene_slimpro_i2c_acpi_ids[] = { >> - {"APMC0D40", 0}, >> + {"APMC0D40", XGENE_SLIMPRO_I2C_V1}, >> + {"APMC0D8B", XGENE_SLIMPRO_I2C_V2}, >> {} >> }; >> MODULE_DEVICE_TABLE(acpi, xgene_slimpro_i2c_acpi_ids); > > -- > Andy Shevchenko > Intel Finland Oy From 1582764269863392577@xxx Tue Oct 31 09:20:33 +0000 2017 X-GM-THRID: 1582724224134356841 X-Gmail-Labels: Inbox,Category Forums