Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2355618imm; Mon, 24 Sep 2018 02:59:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV60ePVkC8VQbWfUz0PlnKZCyRmhjb02pjI+Tl/pzY1J6TF1QvhnYSLFjuwMipf0VtuPaSMEm X-Received: by 2002:a63:8dc1:: with SMTP id z184-v6mr8699362pgd.328.1537783198583; Mon, 24 Sep 2018 02:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537783198; cv=none; d=google.com; s=arc-20160816; b=zeS8PtwSzGua2xexDxcrXSWm9JIsnN4gvAwunghVBYaqwj3UtQvgaRU00Mks8/O4V5 Xpu7hSFZ2Ye+uSSZb90HIpxiop+i55b55iQ1aR/xJCGpOG3OyS46kcfw4yDQTD6CEWP3 w0B1VJBAX7RSVgLH8lvPT2PnJuOkBYdPsg5jJQpsLMLYLg6SDYfnqe8Pu4ruMaxaX5wV ebbysgKsB3ngpN/+/f8Zg1fOTqw8QZUqHN9plp01xNHyyZ0ZWXol+V5KUc9yH05DRjmP zmSszyKZZ62qR9hefZgzswDUi6REXPcvxsF9wTpfS58M/Py6tzhi/0CV0FPZMPfqQaM+ kD6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=fR69evbYKY0nRx0VbdFWLBNuh8q+8tcQCM1+NanWHW0=; b=VfyLNtx+hPPzRB9AA8/3RZI25QXE3fpYwQKUkAGJH6lr18OUyoiMFLD9JinsZk3cyk vr9i2DIQNnDwNr7+J0DHigSf4tbc/jDqlp9pNu1GC/i2NcWRVcXMV/Q+NWmuh1UTUhUK k374CSStOyzBA3SQYTT/bLX1wd0HgTtgpWXN8B1rInUVaLUN5WYs9qVsIR+TLMmdZGTI QX/vDK7hEYFnOx6kjmRtIJAtjSUW71EojYBVWWuJvITE2E3XfKxBs081iOiIB1b89c5b kHP/GN0txrNejFbUjdqy8Y8rgHK5yITZBQOL9Yb42lYLkU0mlZWv6KahtoBynP6v2KXt fn3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=EW2f8KCy; 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=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f130-v6si3686166pgc.625.2018.09.24.02.59.13; Mon, 24 Sep 2018 02:59: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=@synopsys.com header.s=mail header.b=EW2f8KCy; 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=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728410AbeIXPjK (ORCPT + 99 others); Mon, 24 Sep 2018 11:39:10 -0400 Received: from smtprelay4.synopsys.com ([198.182.47.9]:48270 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726241AbeIXPjK (ORCPT ); Mon, 24 Sep 2018 11:39:10 -0400 Received: from mailhost.synopsys.com (mailhost3.synopsys.com [10.12.238.238]) by smtprelay.synopsys.com (Postfix) with ESMTP id 403D724E279F; Mon, 24 Sep 2018 02:37:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1537781879; bh=fR69evbYKY0nRx0VbdFWLBNuh8q+8tcQCM1+NanWHW0=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=EW2f8KCy71osIAozzpH6IdFuPMIOahpqK2OC/PKbji/xz5h1mrsQq6o36DTSSChwz SPtY0zv9J3bPRMFPfnqFK+fonwI3MVsyKoiPnLNKFI0MqAL44PNITRS1qz+xfvWbqK WkFyo1DIo/+cu9XAbOyoVKfEPMrswI6K68xUad3DrAeDub6FDic/QHQdWppbocUJzx vWqDOKbiB1CFXxPrNgk5gCUoOnJQPtgUR3iyBq2UadBMqu4u+RcHUZSggOXRDUEqp1 AE6iNW3PQBERJ8FXn2tM12Mh1W42zRIza3oe4fcWbYBh0XghRijDM+oXRacRQn6OrL 7pxIKK0LaVw/Q== Received: from US01WXQAHTC1.internal.synopsys.com (us01wxqahtc1.internal.synopsys.com [10.12.238.230]) by mailhost.synopsys.com (Postfix) with ESMTP id 0813538FF; Mon, 24 Sep 2018 02:37:59 -0700 (PDT) Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by US01WXQAHTC1.internal.synopsys.com (10.12.238.230) with Microsoft SMTP Server (TLS) id 14.3.361.1; Mon, 24 Sep 2018 02:37:58 -0700 Received: from DE02WEMBXB.internal.synopsys.com ([fe80::95ce:118a:8321:a099]) by DE02WEHTCA.internal.synopsys.com ([::1]) with mapi id 14.03.0361.001; Mon, 24 Sep 2018 11:37:55 +0200 From: Eugeniy Paltsev To: "linux-gpio@vger.kernel.org" , "linus.walleij@linaro.org" CC: "linux-snps-arc@lists.infradead.org" , "linux-kernel@vger.kernel.org" , "mark.rutland@arm.com" , Vineet Gupta , Alexey Brodkin , "robh+dt@kernel.org" , "devicetree@vger.kernel.org" Subject: Re: [PATCH v3 1/2] GPIO: add single-register GPIO via CREG driver Thread-Topic: [PATCH v3 1/2] GPIO: add single-register GPIO via CREG driver Thread-Index: AQHUSeF2AhBDAki6uU2QgGmRDh989KT/Hz8A Date: Mon, 24 Sep 2018 09:37:55 +0000 Message-ID: <1537781874.4902.1.camel@synopsys.com> References: <20180911150925.19460-1-Eugeniy.Paltsev@synopsys.com> <20180911150925.19460-2-Eugeniy.Paltsev@synopsys.com> In-Reply-To: <20180911150925.19460-2-Eugeniy.Paltsev@synopsys.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.121.3.38] Content-Type: text/plain; charset="utf-8" Content-ID: Content-Transfer-Encoding: base64 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SGkgTGludXMsDQoNCk1heWJlIHlvdSBoYXZlIGFueSBjb21tZW50cyBvciByZW1hcmtzIGFib3V0 IHRoaXMgcGF0Y2g/IEFuZCBpZiB5b3UgZG9uJ3QgY291bGQgeW91IHBsZWFzZSBhcHBseSBpdC4N ClRoYW5rcyENCg0KT24gVHVlLCAyMDE4LTA5LTExIGF0IDE4OjA5ICswMzAwLCBFdWdlbml5IFBh bHRzZXYgd3JvdGU6DQo+IEFkZCBzaW5nbGUtcmVnaXN0ZXIgTU1JTyBHUElPIGRyaXZlciBmb3Ig Y29tcGxleCBjYXNlcyB3aGVyZQ0KPiBvbmx5IHNldmVyYWwgZmllbGRzIGluIHJlZ2lzdGVyIGJl bG9uZyB0byBHUElPIGxpbmVzIGFuZCBlYWNoIEdQSU8NCj4gbGluZSBvd25zIGEgZmllbGQgd2l0 aCBkaWZmZXJlbnQgbGVuZ3RoIGFuZCBvbi9vZmYgdmFsdWUuDQo+IA0KPiBTdWNoIENSRUcgR1BJ T3MgYXJlIHVzZWQgaW4gU3lub3BzeXMgQVhTMTB4IGFuZCBIU0RLIGJvYXJkcy4NCj4gDQo+IFNp Z25lZC1vZmYtYnk6IEV1Z2VuaXkgUGFsdHNldiA8RXVnZW5peS5QYWx0c2V2QHN5bm9wc3lzLmNv bT4NCj4gLS0tDQo+IENoYW5nZXMgdjItPnYzOg0KPiAgKiBNb3ZlIHBhcmFtZXRlcnMgaW50byB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