Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp573455ybl; Fri, 13 Dec 2019 00:54:08 -0800 (PST) X-Google-Smtp-Source: APXvYqyNqlV00OWaRaXKRyNL72khmpp9FK+EZ3TEOP7aLrawadsqQDcuM4zHVYTVh0UEbe5t2VEg X-Received: by 2002:a05:6830:1116:: with SMTP id w22mr13820085otq.63.1576227248273; Fri, 13 Dec 2019 00:54:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1576227248; cv=none; d=google.com; s=arc-20160816; b=P/pNRdIjx5pZJnfK2dMl9OfoMwg2fgi5UKN0XvtH8Ge/gXYC8HtMI92zj64xoFDP/l TngNUQxtgxgAe3D3UOwe+XA+yudS3YjlMQS0blpBub7mXWjJ2JQsdCFHAQnOsqyDSiPF hfXA3PxLPi1+AMlpnFgxsJ8rZUG15rvRtrnCH8S4UarNhdGCnHANH8Xz/xbkFkbM13Ht HWVeZxZVkuWchin/bRZRUlTEV8Cm43mV8daJG7Hgr+0VetygvVh4HDeOvL9Yh8YGBsNo nu9qQETaU5u2B++kFsy5mXx6JwebD3e785unuLv+b6qxSSPZwe/IlSMn9vjKhfQbX07j pNZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XhTCXQMz9W16QzlMSFeAKscL9UN80OVD7nIAnDiOOmE=; b=qjMWfsbMncJqpmLIHx9cTwoUWPRLZ6r3FXegdsgslHgtu1aSPB/TNO9DbCz/xbkOtQ h3lgo0UrRAXk7RZECBd3/MpO6ySC0xIM64jvozYSIPQNvuSp3pRS7M8xSJXLsOJH7bwu RbqRdXg8Be3/xD/ukDzHPNjdXuafnqI6daV4B6chODCVTLYKkbmjthBcGQMayy8ksc1V aqxIHNiB2xpmaX8fnLPgcZ6EZ2z2jNDwlHVcm4KuY2xVl5NtJ1yrdlBPo9EFt5n0PsUv U6NcEyxUEA0LUpBN6qUOCTYU2d77webDyWNl5NhrPRBJg9D+qOHKI0xPfZlGDWpRA5vX xOkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Db5yipWK; 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7si4888293otp.323.2019.12.13.00.53.56; Fri, 13 Dec 2019 00:54:08 -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; dkim=pass header.i=@mediatek.com header.s=dk header.b=Db5yipWK; 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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726736AbfLMIxN (ORCPT + 99 others); Fri, 13 Dec 2019 03:53:13 -0500 Received: from mailgw01.mediatek.com ([216.200.240.184]:35114 "EHLO mailgw01.mediatek.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725945AbfLMIxM (ORCPT ); Fri, 13 Dec 2019 03:53:12 -0500 X-UUID: 7c70b67605c5458687a7e11bafcdddd5-20191213 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=XhTCXQMz9W16QzlMSFeAKscL9UN80OVD7nIAnDiOOmE=; b=Db5yipWKuqgNE3knz/yBjVKvN05hRBb7UotvnXqeLVIz8v8oPmH7ZAPsAtgDaJlkiHPR3Boz4O8iilY8dJBIU7WTNswFzt847Bz6Jyc8iE4qVezUQcgTUclzK1xWs8yEEMRHueqe1rgOQcHp94Wi6Oqb38TF28nZ6IJLmMYtc5s=; X-UUID: 7c70b67605c5458687a7e11bafcdddd5-20191213 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 932931311; Fri, 13 Dec 2019 00:53:11 -0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n1.mediatek.inc (172.21.101.77) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 13 Dec 2019 16:11:18 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 13 Dec 2019 16:11:05 +0800 From: Stanley Chu To: , , , , , , CC: , , , , , , , , Stanley Chu Subject: [PATCH v1 1/4] scsi: ufs-mediatek: introduce reference clock control Date: Fri, 13 Dec 2019 16:11:32 +0800 Message-ID: <1576224695-22657-2-git-send-email-stanley.chu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1576224695-22657-1-git-send-email-stanley.chu@mediatek.com> References: <1576224695-22657-1-git-send-email-stanley.chu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SW50cm9kdWNlIHJlZmVyZW5jZSBjbG9jayBjb250cm9sIGluIE1lZGlhVGVrIENoaXBzZXQgaW4g b3JkZXINCnRvIGRpc2FibGUgaXQgaWYgaXQgaXMgbm90IG5lY2Vzc2FyeSBieSBVRlMgZGV2aWNl IHRvIHNhdmUgc3lzdGVtIHBvd2VyLg0KDQpDdXJyZW50bHkgcmVmZX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