Received: by 2002:a89:d88:0:b0:1fa:5c73:8e2d with SMTP id eb8csp2536412lqb; Tue, 28 May 2024 03:05:29 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUUYBO2QStKvkgqPmlPNEHm39fG+/j6/At7AirBGAhSqHMUUIW48zrNyS29iPGFzxDFNkJ9qOMC05i3gWI53ET+dDGVRbNPj4unHL3tKg== X-Google-Smtp-Source: AGHT+IHf2M/vnGvGmoHMGDFCuDp88522k8h/PbnS0GGTPwO3vMz7UXGrB7QjDdY/zq21O6ZLxktA X-Received: by 2002:a05:6512:3107:b0:51b:528e:ce7d with SMTP id 2adb3069b0e04-52966005b6emr8693216e87.34.1716890729303; Tue, 28 May 2024 03:05:29 -0700 (PDT) Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a626c804f6esi483964966b.22.2024.05.28.03.05.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 May 2024 03:05:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-192077-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@axis.com header.s=selector1 header.b=HiUfyLOj; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-192077-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-192077-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 1C98D1F2414C for ; Tue, 28 May 2024 10:05:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0199416ABEE; Tue, 28 May 2024 10:05:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b="HiUfyLOj" Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2049.outbound.protection.outlook.com [40.107.104.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 95C141667D3 for ; Tue, 28 May 2024 10:05:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.49 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716890703; cv=fail; b=klbG2667Jn2GzVKWirjxQqloNEOWzXpBydQWd0IEYAeEn+AS8iTT4pLrAJ+zqCMOZnzJ2TFYp2ts5adSv4oEZW0D7UbERAq8rqni5K8HFXz2zLr0Bt/pV8d21hb0xCv+emFXHv5Yz047vABxYZZFd+GnBFjTPBKDp1GS5uCKErs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716890703; c=relaxed/simple; bh=VBpyXG+gbCw8rxoK/JIyY9EA4yLrIiVv7mWZV9cKl6E=; h=Date:From:To:cc:Subject:Message-ID:Content-Type:MIME-Version; b=U7IxMic2pDspUdNju5dMZblw30zRhvkbJ/lfUSWsBSzpO4v1PjrHBQh+SkWC1rFTk7kotPJ4hMhjQwj6zaECoQT/1s4OMKf33eQ7c3IELjciQP4HNpCwVEZkTNw95dRFcKx/wJabN4FRbu4Efd2NreHAb81ni19PljhPLCFV42s= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com; spf=pass smtp.mailfrom=axis.com; dkim=pass (1024-bit key) header.d=axis.com header.i=@axis.com header.b=HiUfyLOj; arc=fail smtp.client-ip=40.107.104.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=axis.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=axis.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=e2DJRWuyxM366mOO2lB4uKvA6D0UJCKG8rkWpGTsJ8Ur5fVpPQY332T+6e9zCtTgQIJ9yiFxXTDv15RzpqJanNcPmUGIHnVcR9tJ4Du+CtAGaqA4NEcopWrbTq3FGjqcusaVzHYsm2Gb57yzALEX0hUDwDqpA7XfxwVMGtBNJgoULy2ymiO8wDtaTPrzIQaGHLKgr0Ibd5S2zznTxKm1IVjlwhp/FybBeFDFplA6QDBdlRFWjxbDS8yh/5/jZI45FW8dEtYT7YdoatnAIcrOnJuC27ttLj5kb9ZCItGEoHqDqEYkoqwl6dUCbL/b1U1Maf5dqilTPAOMJUuY2dHcmA== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=YufMOriIqzxBP0UZgysfvoHZcRIi0WHOXptjc+s3xPM=; b=QuVxhwtXhmIV7qgWI69Ne2GXMeCRA6t6PyxSb1GMypNijabcHJN/9TAvRHO2TPa60TOj7t+bjUB1LeWlhF5mTAJIe2LdaBIK9LXqbvzhIyDh9ne+ccgJAcOgNFtksNq/oMVFUPnKRqtnIRQ9J2K9+fLdF0VsP1Nob+oUONpVbF5B1c+Id+Auwf6S+3q+om+XZGDOFjfOerq1wzVbgYDPfr7wMAqIW/kPLyidRqmTfHTUqah2UlBX/Gw3VwSlPGczhi+4iQ0h2+n2xJs3PKz93vUTHjSYExXSYFe+Zpky9YUh4UdL+rRqfGMQIWb16Cq6lkXuwhzJJgwXRz4YW9nZeA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=axis.com; dmarc=pass action=none header.from=axis.com; dkim=pass header.d=axis.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=YufMOriIqzxBP0UZgysfvoHZcRIi0WHOXptjc+s3xPM=; b=HiUfyLOjR3392XtkWZnqTo4NeWSo+BnohrLJzNlhWyCOtR7WobBZrtHvWf9tSN/BZrQARtNViSKjyW8XsPm2VdxsKhpN090BcOtyq7ZYGKXQ8tW9fSRs+HSC12U9RgwQtZpAhQADecH2YHO7H8MaHVi4kAYQ5hqxD2gogrhbJsc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=axis.com; Received: from VI1PR02MB3229.eurprd02.prod.outlook.com (2603:10a6:802:24::28) by PA6PR02MB10739.eurprd02.prod.outlook.com (2603:10a6:102:3cb::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7611.29; Tue, 28 May 2024 10:04:51 +0000 Received: from VI1PR02MB3229.eurprd02.prod.outlook.com ([fe80::658d:49ce:8a32:69ca]) by VI1PR02MB3229.eurprd02.prod.outlook.com ([fe80::658d:49ce:8a32:69ca%4]) with mapi id 15.20.7611.025; Tue, 28 May 2024 10:04:51 +0000 Date: Tue, 28 May 2024 12:04:49 +0200 (CEST) From: Ricard Wanderlof To: Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, kernel@axis.com Subject: [PATCH] drm: bridge: adv7511: Accept audio sample widths of 32 bits via I2S Message-ID: <91472c14-3aeb-766a-1716-8219af6e8782@axis.com> Content-Type: text/plain; charset=US-ASCII X-ClientProxiedBy: MM0P280CA0057.SWEP280.PROD.OUTLOOK.COM (2603:10a6:190:b::17) To VI1PR02MB3229.eurprd02.prod.outlook.com (2603:10a6:802:24::28) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR02MB3229:EE_|PA6PR02MB10739:EE_ X-MS-Office365-Filtering-Correlation-Id: c79eb05c-e913-4f6a-0ba3-08dc7efd9d44 X-LD-Processed: 78703d3c-b907-432f-b066-88f7af9ca3af,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|366007|376005|1800799015|7416005|921011; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?jivDxjojaz6NMQNbInjDOF7a9LI2/rmOnTEJDhCyCpuDsh1BNHX7jqmOcB7z?= =?us-ascii?Q?eSMgzFj5MIzNDuNQ/Ss65gGLvItSCDi/lRng2cF0K2EZO6ZYfDrjh/TMYulk?= =?us-ascii?Q?j3mmPr40czszEPnje66vR0NFCruTuw1EZTXdWVfpItUxpMhFnCfkT1J84qPa?= =?us-ascii?Q?DerfNG6yF0KtdKqczzHEe23Jl7LDMucxyrDtgGMmcAH9Emaak2DaFWeHWe7t?= =?us-ascii?Q?lyRvt7EHcBIAV9MBAGqjlt9u49I1Hy1ycmoXro7OVO0TQDoZqKHL5mBjj/o8?= =?us-ascii?Q?XSKddMwTRVmTXJbY0eyhD3ZaxVtc/pDdvcq/Hi/OiBBzUha3rqnEc9iU+xMN?= =?us-ascii?Q?o3wZhsaJCIPY5zv+BEneGDnE6vpgFvdGneaCdlhSUq1K+U1SSoDZopUjWclD?= =?us-ascii?Q?UEQtx2AmOMfyq8hEaRaN3b/oueDBhWZ9hw/TYTIcZZvYkwkRRdxfXzxQdfmk?= =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Z?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:VI1PR02MB3229.eurprd02.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(366007)(376005)(1800799015)(7416005)(921011);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?fyERMwcgVJwcaADVUmp3sdXwUmng3nfhOd21tWwtj/UNA06moxt/3Twrt8VH?= =?us-ascii?Q?vpe55qmeuoJdmw9W+PerQTrKk1JD9s3LhldjYaZ5EpVk7G28Zpi5Hf/tlyFM?= =?us-ascii?Q?8uM6cmRY5KzR9X8vF30xeG3wfcZ80o2zs392TcE9RRQhqHu7GlV+AbS5Yy42?= =?us-ascii?Q?tbsJYn+2hVb6nk2SNbi9omHTxjYO5pDgC9uMBHNyurFZBugdbtrEt/LcddRP?= =?us-ascii?Q?BQm08AC1F5PN5tPVv5OFnaOMYAtPcfu6gKE8KbdQ8bmVw2s530yGNqtw/Kqp?= =?us-ascii?Q?czpJXZPrtzrDtT18eRs3Btfr/hMIIfi4yRenPbmsxlouAmyT8oZeODApNjC7?= =?us-ascii?Q?vykz0nneZDmLr9yMu7ECPyw3wpjWcDSLrjZTztRI0HwZQ9YnOuHsFjzr/oMZ?= =?us-ascii?Q?jkOu6VUQx5RPZH18adDmqICq8U5xIxs/gB6JX9E9NNEBps4Jhb2tyIPXkGxE?= =?us-ascii?Q?bnqQ1FXXtJY2Kasby2DzNgIf9CJwXXJX+XAU1s+M6N7GKoyHA0pYQd+AqRWQ?= =?us-ascii?Q?hiP9u5hl2N80IQ5F+Acu3SgsnlURo94cgbmS65LKpkF2SXPMlbgrfcO5Kuhs?= =?us-ascii?Q?of0jxEU5Ibp7ziRyPLDae6Bu0GlJJp1NhUaTWRDA0x9oowPwKIMZLKbYwmow?= =?us-ascii?Q?H7nghT+pS/SfW+s6Mmr+/oi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?Q?vcRNVhMQwePsC/yWtRfXaTJ4m8YoiYd45fn4LFH1?= X-OriginatorOrg: axis.com X-MS-Exchange-CrossTenant-Network-Message-Id: c79eb05c-e913-4f6a-0ba3-08dc7efd9d44 X-MS-Exchange-CrossTenant-AuthSource: VI1PR02MB3229.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 May 2024 10:04:51.1464 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 78703d3c-b907-432f-b066-88f7af9ca3af X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: U88QP//je2sjWMktlEMG2ddXF1gtMCIvd7LbbGQhqz+RPx7zwh2LOvm9gwXTjoNHZCF4sDKW+Szz2UCpV33RCg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA6PR02MB10739 Even though data is truncated to 24 bits, the I2S interface does accept 32 bit data (the slot widths according to the data sheet can be 16 or 32 bits) so let the hw_params callback reflect this, even if the lowest 8 bits are not used when 32 bits are specified. This is normally how 24 bit audio data is handled (i.e. as 32 bit data, with the LSB:s unused) and this is also reflected in other bridge drivers which handle audio, for instance sii902x.c and synopsis/dw-hdmi-i2s-audio.c . Signed-off-by: Ricard Wanderlof --- drivers/gpu/drm/bridge/adv7511/adv7511_audio.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c index 61f4a38e7d2b..4563f5d8136f 100644 --- a/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_audio.c @@ -101,11 +101,14 @@ static int adv7511_hdmi_hw_params(struct device *dev, void *data, case 20: len = ADV7511_I2S_SAMPLE_LEN_20; break; - case 32: - if (fmt->bit_fmt != SNDRV_PCM_FORMAT_IEC958_SUBFRAME_LE) - return -EINVAL; - fallthrough; case 24: + case 32: + /* + * 32 bits are handled like 24 bits, except that the lowest + * 8 bits are discarded. In fact, the accepted I2S slot widths + * are 16 and 32 bits, so the chip is fully compatible with + * 32 bit data. + */ len = ADV7511_I2S_SAMPLE_LEN_24; break; default: -- 2.30.2