From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from relay7-d.mail.gandi.net ([217.70.183.200]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l6JBO-0004CV-Nj for barebox@lists.infradead.org; Sun, 31 Jan 2021 20:18:56 +0000 Received: from geraet.fritz.box (unknown [87.123.110.69]) (Authenticated sender: ahmad@a3f.at) by relay7-d.mail.gandi.net (Postfix) with ESMTPSA id B644920006 for ; Sun, 31 Jan 2021 20:18:52 +0000 (UTC) From: Ahmad Fatoum Date: Sun, 31 Jan 2021 21:18:41 +0100 Message-Id: <20210131201846.3440477-3-ahmad@a3f.at> In-Reply-To: <20210131201846.3440477-1-ahmad@a3f.at> References: <20210131201846.3440477-1-ahmad@a3f.at> MIME-Version: 1.0 List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Sender: "barebox" Errors-To: barebox-bounces+u.kleine-koenig=pengutronix.de@lists.infradead.org Subject: [PATCH 2/7] drivers: add sound card driver support To: barebox@lists.infradead.org QWRkIGRyaXZlciBjb3JlIGJvaWxlcnBsYXRlIGZvciBzb3VuZCBzdXBwb3J0IGluIGJhcmVib3gu IFVzaW5nIHRoZQpwcm92aWRlZCBBUEkgaW4gPHNvdW5kLmg+LCBjb25zdW1lcnMgY2FuIHBsYXkg YmVlcHMgZm9yIGEgZml4ZWQgZHVyYXRpb24Kb2YgdGltZS4KClBsYXlpbmcgYmVlcHMgaXMgbm90 IGJsb2NraW5nIGFuZCBuZXcgYmVlcHMgY2FuIGJlIGVucXVldWVkIHdoaWxlIG9uZQppcyBhbHJl YWR5IHBsYXlpbmcuIFRoZXkgd2lsbCBiZSBwbGF5ZWQgaW4gc3VjY2Vzc2lvbiBieSBhIHBvbGxl ciwgd2hpY2gKd2lsbCBhbHNvIHR1cm4gb2ZmIHRoZSBzb3VuZCBjYXJkIHdoZW4gdGhlIGJlZXAg dHVuZS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