blob: 1f16d502600c5d887dbb54fea12440bd7bf9692a [file] [log] [blame]
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +03001/*
2 * AHCI SATA platform driver
3 *
4 * Copyright 2004-2005 Red Hat, Inc.
5 * Jeff Garzik <jgarzik@pobox.com>
6 * Copyright 2010 MontaVista Software, LLC.
7 * Anton Vorontsov <avorontsov@ru.mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 */
14
15#ifndef _AHCI_PLATFORM_H
16#define _AHCI_PLATFORM_H
17
Jassi Brar08354802010-06-25 18:21:19 +090018#include <linux/compiler.h>
19
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030020struct device;
21struct ata_port_info;
Hans de Goede156c5882014-02-22 16:53:31 +010022struct ahci_host_priv;
Hans de Goede23b07d42014-02-22 16:53:34 +010023struct platform_device;
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030024
Hans de Goede23b07d42014-02-22 16:53:34 +010025/*
26 * Note ahci_platform_data is deprecated, it is only kept around for use
27 * by the old da850 and spear13xx ahci code.
28 * New drivers should instead declare their own platform_driver struct, and
29 * use ahci_platform* functions in their own probe, suspend and resume methods.
30 */
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030031struct ahci_platform_data {
Jassi Brar08354802010-06-25 18:21:19 +090032 int (*init)(struct device *dev, void __iomem *addr);
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030033 void (*exit)(struct device *dev);
Brian Norris17ab5942011-11-18 11:10:10 -080034 int (*suspend)(struct device *dev);
35 int (*resume)(struct device *dev);
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030036};
37
Hans de Goede156c5882014-02-22 16:53:31 +010038int ahci_platform_enable_clks(struct ahci_host_priv *hpriv);
39void ahci_platform_disable_clks(struct ahci_host_priv *hpriv);
Hans de Goede96a01ba2014-02-22 16:53:33 +010040int ahci_platform_enable_resources(struct ahci_host_priv *hpriv);
41void ahci_platform_disable_resources(struct ahci_host_priv *hpriv);
Hans de Goede23b07d42014-02-22 16:53:34 +010042struct ahci_host_priv *ahci_platform_get_resources(
43 struct platform_device *pdev);
44int ahci_platform_init_host(struct platform_device *pdev,
45 struct ahci_host_priv *hpriv,
46 const struct ata_port_info *pi_template,
47 unsigned int force_port_map,
48 unsigned int mask_port_map);
Hans de Goede156c5882014-02-22 16:53:31 +010049
Hans de Goede648cb6f2014-02-22 16:53:35 +010050int ahci_platform_suspend_host(struct device *dev);
51int ahci_platform_resume_host(struct device *dev);
52int ahci_platform_suspend(struct device *dev);
53int ahci_platform_resume(struct device *dev);
54
Anton Vorontsov1c2a49f2010-03-04 20:06:06 +030055#endif /* _AHCI_PLATFORM_H */