From patchwork Mon Nov 30 06:20:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Parshuram Raju Thombare X-Patchwork-Id: 11939745 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B76F4C5519F for ; Mon, 30 Nov 2020 06:20:17 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2329620757 for ; Mon, 30 Nov 2020 06:20:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="uemUgrk5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="DwCaWpGP"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="jV7SY4Mt" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2329620757 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cadence.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7Oe+WF7N3V7Vc1d7oKm6OToLwDW/IcPzi+a8+2Pqmis=; b=uemUgrk5d7VsS+zD6VH/YeLoQ SpCwYBY1SF8MuI4821kPKDTxd7dbWcdy9pcg7AJSFZhpSoiBvah1LQsVwmlJzPwgjdAD2YRAgfycU Yn7jDKKIARmb1IJjShdjGxUKXEy1QRc1Ivdk4u2pLjn638+oMDBpmYTNpht8cnXgOKzGnHIrtqFRj n2+Isaxg4HtuiMLSKdUbyqQcE1opcX/11v8Q2dPpN5KydUJG5MS8ggd1F7D9NmiGFKBrPqz5XOEAv JCbJ18P2iLfKVzhW30jAtpwqs5eIsBSG4syxJ9YRwcUKid6T8A8vwFxyoXPO92j12iPHSpksUA8U4 BpZwH7R4g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjcXo-00008S-B9; Mon, 30 Nov 2020 06:20:16 +0000 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kjcXm-00007m-Ol for linux-i3c@lists.infradead.org; Mon, 30 Nov 2020 06:20:15 +0000 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 0AU68bUK014443; Sun, 29 Nov 2020 22:20:11 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=6HLJSNbqupKDA6NkIIamnWz2e6tRBqh6fhldFQb6nC8=; b=DwCaWpGPjnTqi0xheNv9eDcrBKdA65fAPckXHfOaaiLF2yGxkvwMC5iPPgXne4ufVNF2 FxDALQI4L3piNU2EpflkLk4zLMxINWvpJxPIyjZfbaokUSf+ammNX24WI+di0AwxGT3M vpzMh0C/ZZGFh+Jk907GBSGB74RAB36wGYmBQmXQZZl3tYKceJzd9Kb3pBqpm6Wm5kHw HmTYR/k3RMczMwrsAslsEfg/yvJP59YEbk5n6R51iMKKb85ObcTBM4v0T7wr7kiTkdqd nnRzrvUxrvQfzGpaVSFJSICrdvnsIIIrM3Gx3G+jnuAnqWUxjuI9r/9WWb4tH8AjYzDM 7w== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2102.outbound.protection.outlook.com [104.47.55.102]) by mx0a-0014ca01.pphosted.com with ESMTP id 353m02v211-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sun, 29 Nov 2020 22:20:11 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D8Gmb9W7sRYS0O2oJ4a0hqWxIkr1bgezliuF3DT97SXyrkXZoHH3E8oqHP68WuA3zCkrHNRUAJcNylehKTz8cVzEZ+o9Z0lVZ3cfZx1T5DHFMU0DigFdCU5Dqsu+L3+Vb/GTVl3kSGCg5FKL0PwGPGB1o0ThYUarJaKFEQP+ZZ9pH5yvHM3sgOVSkW8ykR9S6SssRTdFvb7aH9pYUtILEHkNIPTzU+ZZOXpYKnnWiYy9UGi8SA2A5PDmyNkpG6lz9fxSK3Nbd/miZ/zLqRamidWl/3/SHB3yo6/H3gtU6PHrKMprWxbw2wtDjUOme/ibxN4xah5EBW+s01j/bHZL6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6HLJSNbqupKDA6NkIIamnWz2e6tRBqh6fhldFQb6nC8=; b=NoS1MdoBfX2uX8g5E8hzqgSu5A3auRGH8tT6AlS3lLS7c3vnlfxZpJErFt99AoMIRtbViLPeP4i0vpTy2XalOPizwSOGikrx6RkOo9qQZEHZKCSFJrWrZka2hGcW5RNLJmwvD4/c99G4c6/RnTH97CZMDVXpWudsGbxEJCgLLY4vRE00V/yqRZTHBTkRKlOHHnI8jGc0CocZtLtNrP2raJ2yozas+wOGXEzup4pkF6xCD/QLmTQmRgdFrsW7QHhO3p8XNT3/UK8PvIIXARAO55IyRezRkyobU4cTA+WllM1L20ZBWXh3aIctGW/TOPhxqYb+zNodNDFIaMOUBVHSqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 158.140.1.148) smtp.rcpttodomain=synopsys.com smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6HLJSNbqupKDA6NkIIamnWz2e6tRBqh6fhldFQb6nC8=; b=jV7SY4MtN2qgnVxJAlPgYU6mf4+rGjePeL6FtyeqLpDvWm1ykmAESZw1P07V4hrK+CardTavbTrWn+NNNX85xxyXXKgolbDbU6+/lKCD5I+ODGSzlARhTBYzEW/fY2YEREU3+f+RZjWU3R0z8/l22VF6tIMhzAr0+fmqXJlQKnI= Received: from CO2PR04CA0135.namprd04.prod.outlook.com (2603:10b6:104::13) by DM6PR07MB4330.namprd07.prod.outlook.com (2603:10b6:5:be::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.25; Mon, 30 Nov 2020 06:20:08 +0000 Received: from MW2NAM12FT056.eop-nam12.prod.protection.outlook.com (2603:10b6:104:0:cafe::d1) by CO2PR04CA0135.outlook.office365.com (2603:10b6:104::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.22 via Frontend Transport; Mon, 30 Nov 2020 06:20:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 158.140.1.148) smtp.mailfrom=cadence.com; synopsys.com; dkim=none (message not signed) header.d=none;synopsys.com; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 158.140.1.148 as permitted sender) receiver=protection.outlook.com; client-ip=158.140.1.148; helo=sjmaillnx2.cadence.com; Received: from sjmaillnx2.cadence.com (158.140.1.148) by MW2NAM12FT056.mail.protection.outlook.com (10.13.181.132) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.11 via Frontend Transport; Mon, 30 Nov 2020 06:20:07 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by sjmaillnx2.cadence.com (8.14.4/8.14.4) with ESMTP id 0AU6K5Q7006704 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Sun, 29 Nov 2020 22:20:06 -0800 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Mon, 30 Nov 2020 07:20:04 +0100 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Mon, 30 Nov 2020 07:20:04 +0100 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0AU6K4Zt004243; Mon, 30 Nov 2020 07:20:04 +0100 Received: (from pthombar@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0AU6K4TE004242; Mon, 30 Nov 2020 07:20:04 +0100 From: Parshuram Thombare To: , , Subject: [PATCH v10 6/7] i3c: master: sysfs key for acquire bus Date: Mon, 30 Nov 2020 07:20:02 +0100 Message-ID: <1606717202-4206-1-git-send-email-pthombar@cadence.com> X-Mailer: git-send-email 2.2.2 In-Reply-To: <1606716983-3645-1-git-send-email-pthombar@cadence.com> References: <1606716983-3645-1-git-send-email-pthombar@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 86f731b8-6595-4db2-d39c-08d894f7fbee X-MS-TrafficTypeDiagnostic: DM6PR07MB4330: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:510; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: r03Rn3t/hhqEvbcQahm2lIsPu4VtcGXZpUdtdc0BOa6vRqbRGoLYOQGITUADAjEE7TQTi2BQetPLd9Tj+CgPK4Tnsl6IM2nehZre9UuLlSY+Hl7siCRAspszU6DXn3Kq3LCbdAcKkNp/AGclp3iPKaJcdYaW+kaeoEa0pjuVjlAyYNXvee8o4feZmS3RG9K/NZolh+dbzMBAqGPKIItsQ9BzEUD5jqWudCM1CEHAu/m96X5h8QyS6kHUDWIXgb5VwvdI/5uoS4Vq3yE62rRJfNkXxtPpSmv8PAPHmcARIj2ghuy46i2V6jHJZTOZjr4HJ8h4yNUHgfpG5wZTMxJT2IxOtxa1A/UhbA9K3KkPhVdoVnzqu9bG+4k34+UJoXVeSj/5O+xEO2msvN3PzxroJSysO+hW186rQ5G6yjYUKHc= X-Forefront-Antispam-Report: CIP:158.140.1.148; CTRY:US; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:sjmaillnx2.cadence.com; PTR:unknown.Cadence.COM; CAT:NONE; SFS:(4636009)(39860400002)(376002)(346002)(396003)(136003)(36092001)(46966005)(336012)(82310400003)(426003)(356005)(186003)(70206006)(70586007)(82740400003)(7636003)(47076004)(83380400001)(478600001)(5660300002)(8676002)(8936002)(86362001)(26005)(2906002)(54906003)(42186006)(110136005)(36906005)(316002)(4326008)(107886003)(2616005)(36756003); DIR:OUT; SFP:1101; X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Nov 2020 06:20:07.6941 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 86f731b8-6595-4db2-d39c-08d894f7fbee X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9; Ip=[158.140.1.148]; Helo=[sjmaillnx2.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: MW2NAM12FT056.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR07MB4330 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.312, 18.0.737 definitions=2020-11-30_01:2020-11-26, 2020-11-30 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 mlxscore=0 malwarescore=0 bulkscore=0 priorityscore=1501 clxscore=1015 impostorscore=0 adultscore=0 spamscore=0 suspectscore=0 mlxlogscore=944 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2011300041 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201130_012014_960466_A922AE24 X-CRM114-Status: GOOD ( 16.77 ) X-BeenThere: linux-i3c@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: praneeth@ti.com, mparab@cadence.com, linux-i3c@lists.infradead.org, linux-kernel@vger.kernel.org, Parshuram Thombare Sender: "linux-i3c" Errors-To: linux-i3c-bounces+linux-i3c=archiver.kernel.org@lists.infradead.org Added support to acquire I3C bus through sysfs interface. Signed-off-by: Parshuram Thombare --- drivers/i3c/master.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index c01ba00..beb7495 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -581,6 +581,23 @@ static ssize_t i2c_scl_frequency_show(struct device *dev, } static DEVICE_ATTR_RO(i2c_scl_frequency); +static ssize_t i3c_acquire_bus_store(struct device *dev, + struct device_attribute *attr, + const char *buf, size_t count) +{ + struct i3c_master_controller *master = dev_to_i3cmaster(dev); + int ret; + + i3c_bus_normaluse_lock(&master->bus); + ret = i3c_master_acquire_bus(master); + i3c_bus_normaluse_unlock(&master->bus); + if (!ret) + i3c_master_enable_mr_events(master); + + return ret ?: count; +} +static DEVICE_ATTR_WO(i3c_acquire_bus); + static struct attribute *i3c_masterdev_attrs[] = { &dev_attr_mode.attr, &dev_attr_current_master.attr, @@ -591,6 +608,7 @@ static ssize_t i2c_scl_frequency_show(struct device *dev, &dev_attr_pid.attr, &dev_attr_dynamic_address.attr, &dev_attr_hdrcap.attr, + &dev_attr_i3c_acquire_bus.attr, NULL, }; ATTRIBUTE_GROUPS(i3c_masterdev);