From patchwork Fri Jan 29 16:04:14 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 43994 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id F008AB7D32 for ; Sat, 30 Jan 2010 03:20:26 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753556Ab0A2QUG (ORCPT ); Fri, 29 Jan 2010 11:20:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753505Ab0A2QE3 (ORCPT ); Fri, 29 Jan 2010 11:04:29 -0500 Received: from mail-fx0-f220.google.com ([209.85.220.220]:53041 "EHLO mail-fx0-f220.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752421Ab0A2QEW (ORCPT ); Fri, 29 Jan 2010 11:04:22 -0500 Received: by mail-fx0-f220.google.com with SMTP id 20so2015120fxm.21 for ; Fri, 29 Jan 2010 08:04:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :in-reply-to:references:subject; bh=lKtPCUNK/W/qYm3BQVJjOI6E8mUSxkfD4bnJhkTKanc=; b=FXAY61/5iFoJ5R2eoZk9T1GJc/+LxLX2Z+wgSgC5OuP7CjVtzrm2kpuTvPUpUDZBQq EGtt1B7pOyLVdH9DA+QqbVoBSAdxnuqPB6aGPaG0hK7C8ck4DYsIHdrj76D/L1G3tJtf rJMZbeIJ7LiSBuUE6dptTwWMAm8fP+GJdu9G0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:in-reply-to:references:subject; b=VL+q9CodJriH7xChj8xw5bXMu78G8KBlzjn9YkNhZ/H3JC3xJoGaYG7UAJHPBfSD/g XwX7sQtwMR1ocJMugAJ783lqiqAYb058TXHK6A2jekfm9/CP36nR+IEghCjKKdgjIEAs fSa7u9OJpzs40/hh281nrNf/HQMkF1Lavsh/4= Received: by 10.223.5.23 with SMTP id 23mr896505fat.53.1264781061630; Fri, 29 Jan 2010 08:04:21 -0800 (PST) Received: from ?127.0.0.1? (chello089079027028.chello.pl [89.79.27.28]) by mx.google.com with ESMTPS id 15sm548396fxm.14.2010.01.29.08.04.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 29 Jan 2010 08:04:21 -0800 (PST) From: Bartlomiej Zolnierkiewicz To: linux-ide@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , linux-kernel@vger.kernel.org Date: Fri, 29 Jan 2010 17:04:14 +0100 Message-Id: <20100129160414.21495.6865.sendpatchset@localhost> In-Reply-To: <20100129160308.21495.14120.sendpatchset@localhost> References: <20100129160308.21495.14120.sendpatchset@localhost> Subject: [PATCH 10/68] ata_piix: move short cable handling to ata_piix.h Sender: linux-ide-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ide@vger.kernel.org From: Bartlomiej Zolnierkiewicz Subject: [PATCH] ata_piix: move short cable handling to ata_piix.h It is a generic code and can be shared between ata_piix & piix drivers. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ata/ata_piix.c | 45 +-------------------------------------------- drivers/ata/ata_piix.h | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 44 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-ide" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: b/drivers/ata/ata_piix.c =================================================================== --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c @@ -581,50 +581,7 @@ MODULE_LICENSE("GPL"); MODULE_DEVICE_TABLE(pci, piix_pci_tbl); MODULE_VERSION(DRV_VERSION); -struct ich_laptop { - u16 device; - u16 subvendor; - u16 subdevice; -}; - -/* - * List of laptops that use short cables rather than 80 wire - */ - -static const struct ich_laptop ich_laptop[] = { - /* devid, subvendor, subdev */ - { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ - { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */ - { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ - { 0x27DF, 0x1028, 0x02b0 }, /* ICH7 on unknown Dell */ - { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ - { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ - { 0x27DF, 0x103C, 0x361a }, /* ICH7 on unkown HP */ - { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */ - { 0x27DF, 0x152D, 0x0778 }, /* ICH7 on unknown Intel */ - { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ - { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ - { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ - { 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */ - { 0x27df, 0x104d, 0x900e }, /* ICH7 on Sony TZ-90 */ - /* end marker */ - { 0, } -}; - -static int ich_short_ata40(struct pci_dev *pdev) -{ - const struct ich_laptop *lap = &ich_laptop[0]; - - while (lap->device) { - if (lap->device == pdev->device && - lap->subvendor == pdev->subsystem_vendor && - lap->subdevice == pdev->subsystem_device) - return 1; - lap++; - } - - return 0; -} +#include "ata_piix.h" /** * ich_pata_cable_detect - Probe host controller cable detect info Index: b/drivers/ata/ata_piix.h =================================================================== --- /dev/null +++ b/drivers/ata/ata_piix.h @@ -0,0 +1,45 @@ + +struct ich_laptop { + u16 device; + u16 subvendor; + u16 subdevice; +}; + +/* + * List of laptops that use short cables rather than 80 wire + */ + +static const struct ich_laptop ich_laptop[] = { + /* devid, subvendor, subdev */ + { 0x27DF, 0x0005, 0x0280 }, /* ICH7 on Acer 5602WLMi */ + { 0x27DF, 0x1025, 0x0102 }, /* ICH7 on Acer 5602aWLMi */ + { 0x27DF, 0x1025, 0x0110 }, /* ICH7 on Acer 3682WLMi */ + { 0x27DF, 0x1028, 0x02b0 }, /* ICH7 on unknown Dell */ + { 0x27DF, 0x1043, 0x1267 }, /* ICH7 on Asus W5F */ + { 0x27DF, 0x103C, 0x30A1 }, /* ICH7 on HP Compaq nc2400 */ + { 0x27DF, 0x103C, 0x361a }, /* ICH7 on unkown HP */ + { 0x27DF, 0x1071, 0xD221 }, /* ICH7 on Hercules EC-900 */ + { 0x27DF, 0x152D, 0x0778 }, /* ICH7 on unknown Intel */ + { 0x24CA, 0x1025, 0x0061 }, /* ICH4 on ACER Aspire 2023WLMi */ + { 0x24CA, 0x1025, 0x003d }, /* ICH4 on ACER TM290 */ + { 0x266F, 0x1025, 0x0066 }, /* ICH6 on ACER Aspire 1694WLMi */ + { 0x2653, 0x1043, 0x82D8 }, /* ICH6M on Asus Eee 701 */ + { 0x27df, 0x104d, 0x900e }, /* ICH7 on Sony TZ-90 */ + /* end marker */ + { 0, } +}; + +static int ich_short_ata40(struct pci_dev *pdev) +{ + const struct ich_laptop *lap = &ich_laptop[0]; + + while (lap->device) { + if (lap->device == pdev->device && + lap->subvendor == pdev->subsystem_vendor && + lap->subdevice == pdev->subsystem_device) + return 1; + lap++; + } + + return 0; +}