#include <linux/soundcard.h>
#include <linux/sysrq.h>
#include <linux/delay.h>
-#include <linux/device.h>
+#include <linux/platform_device.h>
#include <linux/completion.h>
#include <asm/uaccess.h>
static int audio_release(struct inode *inode, struct file *file);
-static int audio_probe(struct device *dev);
+static int audio_probe(struct platform_device *pdev);
-static int audio_remove(struct device *dev);
+static int audio_remove(struct platform_device *pdev);
-static void audio_shutdown(struct device *dev);
+static void audio_shutdown(struct platform_device *pdev);
-static int audio_suspend(struct device *dev, pm_message_t mesg, u32 level);
+static int audio_suspend(struct platform_device *pdev, pm_message_t mesg);
-static int audio_resume(struct device *dev, u32 level);
+static int audio_resume(struct platform_device *pdev);
static void audio_free(struct device *dev);
};
/* Driver information */
-static struct device_driver omap_audio_driver = {
- .name = OMAP_AUDIO_NAME,
- .bus = &platform_bus_type,
+static struct platform_driver omap_audio_driver = {
.probe = audio_probe,
.remove = audio_remove,
.suspend = audio_suspend,
- .resume = audio_resume,
.shutdown = audio_shutdown,
+ .resume = audio_resume,
+ .driver = {
+ .name = OMAP_AUDIO_NAME,
+ },
};
/* Device Information */
* WARNING!!!! : It is expected that the codec would have registered with us by now
*
*********************************************************************************/
-static int audio_probe(struct device *dev)
+static int audio_probe(struct platform_device *pdev)
{
int ret;
FN_IN;
* audio_remove() Function to handle removal operations
*
*********************************************************************************/
-static int audio_remove(struct device *dev)
+static int audio_remove(struct platform_device *pdev)
{
FN_IN;
if (audio_state.hw_remove) {
* audio_shutdown(): Function to handle shutdown operations
*
*********************************************************************************/
-static void audio_shutdown(struct device *dev)
+static void audio_shutdown(struct platform_device *pdev)
{
FN_IN;
if (audio_state.hw_cleanup) {
* audio_suspend(): Function to handle suspend operations
*
*********************************************************************************/
-static int audio_suspend(struct device *dev, pm_message_t mesg, u32 level)
+static int audio_suspend(struct platform_device *pdev, pm_message_t mesg)
{
int ret = 0;
#ifdef CONFIG_PM
- void *data = dev->driver_data;
+ void *data = pdev->dev.driver_data;
FN_IN;
- if (level != SUSPEND_POWER_DOWN) {
- return 0;
- }
if (audio_state.hw_suspend) {
ret = audio_ldm_suspend(data);
if (ret == 0)
* audio_resume(): Function to handle resume operations
*
*********************************************************************************/
-static int audio_resume(struct device *dev, u32 level)
+static int audio_resume(struct platform_device *dev)
{
int ret = 0;
#ifdef CONFIG_PM
- void *data = dev->driver_data;
+ void *data = pdev->dev.driver_data;
FN_IN;
- if (level != RESUME_POWER_ON) {
- return 0;
- }
if (audio_state.hw_resume) {
ret = audio_ldm_resume(data);
if (ret == 0)
goto register_out;
}
- ret = driver_register(&omap_audio_driver);
+ ret = platform_driver_register(&omap_audio_driver);
if (ret != 0) {
printk(KERN_ERR "Device Register failed =%d\n", ret);
ret = -ENODEV;
return -EPERM;
}
- driver_unregister(&omap_audio_driver);
+ platform_driver_unregister(&omap_audio_driver);
platform_device_unregister(&omap_audio_device);
memset(&audio_state, 0, sizeof(audio_state_t));