#include <linux/err.h>
 #include <linux/clk.h>
 #include <linux/platform_device.h>
-#include <linux/gpio.h>
 #include <linux/io.h>
 #include <linux/slab.h>
 
        unsigned char            fiq_inuse;
        unsigned char            fiq_claimed;
 
-       void                    (*set_cs)(struct s3c2410_spi_info *spi,
-                                         int cs, int pol);
-
        /* data buffers */
        const unsigned char     *tx;
        unsigned char           *rx;
        return spi_master_get_devdata(sdev->master);
 }
 
-static void s3c24xx_spi_gpiocs(struct s3c2410_spi_info *spi, int cs, int pol)
-{
-       gpio_set_value(spi->pin_cs, pol);
-}
-
 static void s3c24xx_spi_chipsel(struct spi_device *spi, int value)
 {
        struct s3c24xx_spi_devstate *cs = spi->controller_state;
        struct s3c24xx_spi *hw = to_hw(spi);
-       unsigned int cspol = spi->mode & SPI_CS_HIGH ? 1 : 0;
 
        /* change the chipselect state and the state of the spi engine clock */
 
        switch (value) {
        case BITBANG_CS_INACTIVE:
-               hw->set_cs(hw->pdata, spi->chip_select, cspol^1);
                writeb(cs->spcon, hw->regs + S3C2410_SPCON);
                break;
 
        case BITBANG_CS_ACTIVE:
                writeb(cs->spcon | S3C2410_SPCON_ENSCK,
                       hw->regs + S3C2410_SPCON);
-               hw->set_cs(hw->pdata, spi->chip_select, cspol);
                break;
        }
 }
        writeb(0xff, hw->regs + S3C2410_SPPRE);
        writeb(SPPIN_DEFAULT, hw->regs + S3C2410_SPPIN);
        writeb(SPCON_DEFAULT, hw->regs + S3C2410_SPCON);
-
-       if (hw->pdata) {
-               if (hw->set_cs == s3c24xx_spi_gpiocs)
-                       gpio_direction_output(hw->pdata->pin_cs, 1);
-
-               if (hw->pdata->gpio_setup)
-                       hw->pdata->gpio_setup(hw->pdata, 1);
-       }
 }
 
 static int s3c24xx_spi_probe(struct platform_device *pdev)
        master->num_chipselect = hw->pdata->num_cs;
        master->bus_num = pdata->bus_num;
        master->bits_per_word_mask = SPI_BPW_MASK(8);
+       /* we need to call the local chipselect callback */
+       master->flags = SPI_MASTER_GPIO_SS;
+       master->use_gpio_descriptors = true;
 
        /* setup the state for the bitbang driver */
 
                goto err_no_pdata;
        }
 
-       /* setup any gpio we can */
-
-       if (!pdata->set_cs) {
-               if (pdata->pin_cs < 0) {
-                       dev_err(&pdev->dev, "No chipselect pin\n");
-                       err = -EINVAL;
-                       goto err_register;
-               }
-
-               err = devm_gpio_request(&pdev->dev, pdata->pin_cs,
-                                       dev_name(&pdev->dev));
-               if (err) {
-                       dev_err(&pdev->dev, "Failed to get gpio for cs\n");
-                       goto err_register;
-               }
-
-               hw->set_cs = s3c24xx_spi_gpiocs;
-               gpio_direction_output(pdata->pin_cs, 1);
-       } else
-               hw->set_cs = pdata->set_cs;
-
        s3c24xx_spi_initialsetup(hw);
 
        /* register our spi controller */
        if (ret)
                return ret;
 
-       if (hw->pdata && hw->pdata->gpio_setup)
-               hw->pdata->gpio_setup(hw->pdata, 0);
-
        clk_disable(hw->clk);
        return 0;
 }
 
 #define __LINUX_SPI_S3C24XX_H __FILE__
 
 struct s3c2410_spi_info {
-       int                      pin_cs;        /* simple gpio cs */
        unsigned int             num_cs;        /* total chipselects */
        int                      bus_num;       /* bus number to use. */
-
        unsigned int             use_fiq:1;     /* use fiq */
-
-       void (*gpio_setup)(struct s3c2410_spi_info *spi, int enable);
-       void (*set_cs)(struct s3c2410_spi_info *spi, int cs, int pol);
 };
 
 extern int s3c24xx_set_fiq(unsigned int irq, u32 *ack_ptr, bool on);