Merge branch 'linus-4.14-rc4-acp-prereq' of git://people.freedesktop.org/~agd5f/linux...
authorDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 19:53:39 +0000 (05:53 +1000)
committerDave Airlie <airlied@redhat.com>
Mon, 13 Nov 2017 19:53:39 +0000 (05:53 +1000)
This is a shared tree between drm and audio for some amd bits.

* 'linus-4.14-rc4-acp-prereq' of git://people.freedesktop.org/~agd5f/linux:
  drm/amdgpu Moving amdgpu asic types to a separate file
  ASoC: AMD: Added asic_type as ACP DMA driver platform data
  drm/amd/amdgpu: Added asic_type as ACP DMA driver platform data

drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c
drivers/gpu/drm/amd/include/amd_shared.h
include/drm/amd_asic_type.h [new file with mode: 0644]
sound/soc/amd/acp-pcm-dma.c
sound/soc/amd/acp.h

index 023bfdb3e63f58dfd71c157cf663ac2b6220cd73..c04f44a90392639e7ec3ae51da93a694ead70fee 100644 (file)
@@ -382,6 +382,8 @@ static int acp_hw_init(void *handle)
        adev->acp.acp_cell[0].name = "acp_audio_dma";
        adev->acp.acp_cell[0].num_resources = 4;
        adev->acp.acp_cell[0].resources = &adev->acp.acp_res[0];
+       adev->acp.acp_cell[0].platform_data = &adev->asic_type;
+       adev->acp.acp_cell[0].pdata_size = sizeof(adev->asic_type);
 
        adev->acp.acp_cell[1].name = "designware-i2s";
        adev->acp.acp_cell[1].num_resources = 1;
index de6fc2731b982e9b71ca92fda3245c692d9664db..b72f8a43d86b43393198e0b737b6a8d654e89065 100644 (file)
 #ifndef __AMD_SHARED_H__
 #define __AMD_SHARED_H__
 
-#define AMD_MAX_USEC_TIMEOUT           200000  /* 200 ms */
+#include <drm/amd_asic_type.h>
 
 struct seq_file;
 
-/*
- * Supported ASIC types
- */
-enum amd_asic_type {
-       CHIP_TAHITI = 0,
-       CHIP_PITCAIRN,
-       CHIP_VERDE,
-       CHIP_OLAND,
-       CHIP_HAINAN,
-       CHIP_BONAIRE,
-       CHIP_KAVERI,
-       CHIP_KABINI,
-       CHIP_HAWAII,
-       CHIP_MULLINS,
-       CHIP_TOPAZ,
-       CHIP_TONGA,
-       CHIP_FIJI,
-       CHIP_CARRIZO,
-       CHIP_STONEY,
-       CHIP_POLARIS10,
-       CHIP_POLARIS11,
-       CHIP_POLARIS12,
-       CHIP_VEGA10,
-       CHIP_RAVEN,
-       CHIP_LAST,
-};
+#define AMD_MAX_USEC_TIMEOUT           200000  /* 200 ms */
 
 /*
  * Chip flags
diff --git a/include/drm/amd_asic_type.h b/include/drm/amd_asic_type.h
new file mode 100644 (file)
index 0000000..599028f
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright 2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ */
+
+#ifndef __AMD_ASIC_TYPE_H__
+#define __AMD_ASIC_TYPE_H__
+/*
+ * Supported ASIC types
+ */
+enum amd_asic_type {
+       CHIP_TAHITI = 0,
+       CHIP_PITCAIRN,
+       CHIP_VERDE,
+       CHIP_OLAND,
+       CHIP_HAINAN,
+       CHIP_BONAIRE,
+       CHIP_KAVERI,
+       CHIP_KABINI,
+       CHIP_HAWAII,
+       CHIP_MULLINS,
+       CHIP_TOPAZ,
+       CHIP_TONGA,
+       CHIP_FIJI,
+       CHIP_CARRIZO,
+       CHIP_STONEY,
+       CHIP_POLARIS10,
+       CHIP_POLARIS11,
+       CHIP_POLARIS12,
+       CHIP_VEGA10,
+       CHIP_RAVEN,
+       CHIP_LAST,
+};
+
+#endif /*__AMD_ASIC_TYPE_H__ */
index 08b1399d1da2b818b997b752555532ebdf45312e..dcbf9973884d9eaf7db31ea62976d4fa4017ecab 100644 (file)
@@ -73,12 +73,6 @@ static const struct snd_pcm_hardware acp_pcm_hardware_capture = {
        .periods_max = CAPTURE_MAX_NUM_PERIODS,
 };
 
-struct audio_drv_data {
-       struct snd_pcm_substream *play_stream;
-       struct snd_pcm_substream *capture_stream;
-       void __iomem *acp_mmio;
-};
-
 static u32 acp_reg_read(void __iomem *acp_mmio, u32 reg)
 {
        return readl(acp_mmio + (reg * 4));
@@ -916,6 +910,7 @@ static int acp_audio_probe(struct platform_device *pdev)
        int status;
        struct audio_drv_data *audio_drv_data;
        struct resource *res;
+       const u32 *pdata = pdev->dev.platform_data;
 
        audio_drv_data = devm_kzalloc(&pdev->dev, sizeof(struct audio_drv_data),
                                        GFP_KERNEL);
@@ -932,6 +927,7 @@ static int acp_audio_probe(struct platform_device *pdev)
 
        audio_drv_data->play_stream = NULL;
        audio_drv_data->capture_stream = NULL;
+       audio_drv_data->asic_type =  *pdata;
 
        res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
        if (!res) {
index 330832ef4e5e57e8c66114d6cc2c4773e64f7b53..28cf9140f49c7de20fad6f845888b20d608d1129 100644 (file)
@@ -84,6 +84,13 @@ struct audio_substream_data {
        void __iomem *acp_mmio;
 };
 
+struct audio_drv_data {
+       struct snd_pcm_substream *play_stream;
+       struct snd_pcm_substream *capture_stream;
+       void __iomem *acp_mmio;
+       u32 asic_type;
+};
+
 enum {
        ACP_TILE_P1 = 0,
        ACP_TILE_P2,