Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1399247pxj; Fri, 21 May 2021 13:17:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwiQVTCpHw/WaeluFjnpy+FADBE9ioFrAAcNmi774rWULPhA5RBN8XQ3gSumdmlJ8+nLvRk X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr12864646edx.332.1621628259058; Fri, 21 May 2021 13:17:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621628259; cv=none; d=google.com; s=arc-20160816; b=su8e3PQZVpSxkEU5Vd2NnBB5KUBYuLyhixM866EMnGZZAKaV5ZJDNrbk3oHkec9UXq icv/8FPQdSKwdX1xrZiTyGWlakeMyIKCCp9c7yl/ohiW27aZyU5SAfLttx4tCGZoMC8v 6JQBQYtT6MEONH3dfslW9FoADAGCBRItMBvNWZ/RIB8JRN19YqUnxzgjok/FL3B4nXjL V2sAbDFCBcWrv7Vi6GB0VPCIxNc2H4Cuzv7uFGY5MN9hHOY8m2qYifCm9rOqprocEUVN nu0HoOSEvlSnPN/GPNoKYtUC4YKJAV759IHaC51W/HEG63BG33wwysRr4a59FmMlr9q5 wgeQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=V1gxdxAqE5/3jzNTtDShs24ciotxYSKj3fPo7ElvmCQ=; b=Jmofm15ORK7iIli+mgEpercgjjjngDeFwZh3yC1L9XoplWjffy9Z1HTCDZKBVnT7sZ MAI6hXZlZ+25uKQpQffMnr6VE3b7MHeCHLzMnk2awWOkkL4NYHJOD/RNPSU73oUcH+4g +o6R4awKykBDtqgyqczF5RZnK21r09aDhwHy12DP3eO4aBgocu3naJVTMQPmYdvpFbbE P5LorSphw8e1g4fCjEYDAfRTwfRuliYVJFKUDA4rK6PaEvIaZwkY6ltRJ4Zl5+hm1bW+ EctCILPqDTvKtdEV2WTQrVwiKSNWg0E7Z6n0RQ9XCO51iogD7wwJVUO+391By1bzlfyV B4dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSWkQJ5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bl1si6489383ejb.408.2021.05.21.13.17.15; Fri, 21 May 2021 13:17:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NSWkQJ5q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233233AbhEUNwD (ORCPT + 99 others); Fri, 21 May 2021 09:52:03 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:44222 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231758AbhEUNwD (ORCPT ); Fri, 21 May 2021 09:52:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621605039; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=V1gxdxAqE5/3jzNTtDShs24ciotxYSKj3fPo7ElvmCQ=; b=NSWkQJ5qHVUFvV0fwkvqY7O557SZVIG7ax+fgPs1YhNunTZUSBB2Lbr1gsRpK1LWzMHeRg QXunpBIrhGVFBlV1XcF0tsjKvth+dWGgTyykKkEi39N3oaBZxmu9+Z3YXIHj40LiDZ2rJz a9vbc4FGufvKObKLuqpbldT9cXJlmzI= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-481-SUnhcu_BOSGsfXalEPfgww-1; Fri, 21 May 2021 09:50:33 -0400 X-MC-Unique: SUnhcu_BOSGsfXalEPfgww-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B8A4A40C5; Fri, 21 May 2021 13:50:31 +0000 (UTC) Received: from x1.localdomain (ovpn-114-187.ams2.redhat.com [10.36.114.187]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7CA0410013D6; Fri, 21 May 2021 13:50:29 +0000 (UTC) From: Hans de Goede To: Lee Jones , Liam Girdwood , Mark Brown Cc: Hans de Goede , linux-kernel@vger.kernel.org, Charles Keepax , patches@opensource.cirrus.com, alsa-devel@alsa-project.org Subject: [PATCH] mfd: arizona: Allow building arizona MFD-core as module Date: Fri, 21 May 2021 15:50:23 +0200 Message-Id: <20210521135023.192688-1-hdegoede@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org There is no reason why the arizona core,irq and codec model specific regmap bits cannot be build as a module. All they do is export symbols which are used by the arizona-spi/i2c and arizona-codec modules, which themselves can be built as module. Change the Kconfig and Makefile arizona bits so that the arizona MFD-core can be built as a module. This is especially useful on x86 platforms with a WM5102 codec, this allows the arizona MFD driver necessary for the WM5102 codec to be enabled in generic distro-kernels without growing the base kernel-image size. Note this also adds an explicit "depends on MFD_ARIZONA" to all the arizona codec Kconfig options. The codec drivers use functions from mfd arizona-core. These new depends are necessary to disallow the codec drivers being builtin when the arizona-core is build as a module, otherwise we end up with missing symbol errors when building vmlinuz. Signed-off-by: Hans de Goede --- Changes in v2: - Add explicit "depends on MFD_ARIZONA" to all the arizona codec Kconfigs --- drivers/mfd/Kconfig | 2 +- drivers/mfd/Makefile | 14 +++++++------- drivers/mfd/arizona-core.c | 2 ++ sound/soc/codecs/Kconfig | 10 +++++----- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index 5c7f2b100191..3fb048361b11 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1788,7 +1788,7 @@ config MFD_ARIZONA select REGMAP select REGMAP_IRQ select MFD_CORE - bool + tristate config MFD_ARIZONA_I2C tristate "Cirrus Logic/Wolfson Microelectronics Arizona platform with I2C" diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 4f6d2b8a5f76..ebc9b6704e87 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -41,24 +41,24 @@ obj-$(CONFIG_MFD_TQMX86) += tqmx86.o obj-$(CONFIG_MFD_LOCHNAGAR) += lochnagar-i2c.o -obj-$(CONFIG_MFD_ARIZONA) += arizona-core.o -obj-$(CONFIG_MFD_ARIZONA) += arizona-irq.o +arizona-objs := arizona-core.o arizona-irq.o +obj-$(CONFIG_MFD_ARIZONA) += arizona.o obj-$(CONFIG_MFD_ARIZONA_I2C) += arizona-i2c.o obj-$(CONFIG_MFD_ARIZONA_SPI) += arizona-spi.o ifeq ($(CONFIG_MFD_WM5102),y) -obj-$(CONFIG_MFD_ARIZONA) += wm5102-tables.o +arizona-objs += wm5102-tables.o endif ifeq ($(CONFIG_MFD_WM5110),y) -obj-$(CONFIG_MFD_ARIZONA) += wm5110-tables.o +arizona-objs += wm5110-tables.o endif ifeq ($(CONFIG_MFD_WM8997),y) -obj-$(CONFIG_MFD_ARIZONA) += wm8997-tables.o +arizona-objs += wm8997-tables.o endif ifeq ($(CONFIG_MFD_WM8998),y) -obj-$(CONFIG_MFD_ARIZONA) += wm8998-tables.o +arizona-objs += wm8998-tables.o endif ifeq ($(CONFIG_MFD_CS47L24),y) -obj-$(CONFIG_MFD_ARIZONA) += cs47l24-tables.o +arizona-objs += cs47l24-tables.o endif obj-$(CONFIG_MFD_WCD934X) += wcd934x.o obj-$(CONFIG_MFD_WM8400) += wm8400-core.o diff --git a/drivers/mfd/arizona-core.c b/drivers/mfd/arizona-core.c index ce6fe6de34f8..9323b1e3a69e 100644 --- a/drivers/mfd/arizona-core.c +++ b/drivers/mfd/arizona-core.c @@ -1447,3 +1447,5 @@ int arizona_dev_exit(struct arizona *arizona) return 0; } EXPORT_SYMBOL_GPL(arizona_dev_exit); + +MODULE_LICENSE("GPL v2"); diff --git a/sound/soc/codecs/Kconfig b/sound/soc/codecs/Kconfig index 2a7b3e363069..45aa92598066 100644 --- a/sound/soc/codecs/Kconfig +++ b/sound/soc/codecs/Kconfig @@ -689,7 +689,7 @@ config SND_SOC_CS47L15 config SND_SOC_CS47L24 tristate - depends on MFD_CS47L24 + depends on MFD_CS47L24 && MFD_ARIZONA config SND_SOC_CS47L35 tristate @@ -1558,11 +1558,11 @@ config SND_SOC_WM5100 config SND_SOC_WM5102 tristate - depends on MFD_WM5102 + depends on MFD_WM5102 && MFD_ARIZONA config SND_SOC_WM5110 tristate - depends on MFD_WM5110 + depends on MFD_WM5110 && MFD_ARIZONA config SND_SOC_WM8350 tristate @@ -1727,11 +1727,11 @@ config SND_SOC_WM8996 config SND_SOC_WM8997 tristate - depends on MFD_WM8997 + depends on MFD_WM8997 && MFD_ARIZONA config SND_SOC_WM8998 tristate - depends on MFD_WM8998 + depends on MFD_WM8998 && MFD_ARIZONA config SND_SOC_WM9081 tristate -- 2.31.1