diff mbox

[2/2] mfd: dln2: add support for USB-SPI module

Message ID 1415364314-30320-3-git-send-email-laurentiu.palcu@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Laurentiu Palcu Nov. 7, 2014, 12:45 p.m. UTC
Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
---
 drivers/mfd/dln2.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Comments

Mark Brown Nov. 8, 2014, 10:33 a.m. UTC | #1
On Fri, Nov 07, 2014 at 02:45:14PM +0200, Laurentiu Palcu wrote:
> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>

Acked-by: Mark Brown <broonie@kernel.org>
Lee Jones Nov. 10, 2014, 9:30 a.m. UTC | #2
On Fri, 07 Nov 2014, Laurentiu Palcu wrote:

> Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> ---
>  drivers/mfd/dln2.c | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> index 9765a17..0cdad2d 100644
> --- a/drivers/mfd/dln2.c
> +++ b/drivers/mfd/dln2.c
> @@ -52,6 +52,7 @@ enum dln2_handle {
>  	DLN2_HANDLE_CTRL,
>  	DLN2_HANDLE_GPIO,
>  	DLN2_HANDLE_I2C,
> +	DLN2_HANDLE_SPI,
>  	DLN2_HANDLES
>  };
>  
> @@ -634,6 +635,12 @@ static struct dln2_platform_data dln2_pdata_i2c = {
>  	.port = 0,
>  };
>  
> +/* Only one SPI port supported */
> +static struct dln2_platform_data dln2_pdata_spi = {

Is this ever fiddled with?  If not, const?

> +	.handle = DLN2_HANDLE_SPI,
> +	.port = 0,
> +};
> +
>  static const struct mfd_cell dln2_devs[] = {
>  	{
>  		.name = "dln2-gpio",
> @@ -645,6 +652,11 @@ static const struct mfd_cell dln2_devs[] = {
>  		.platform_data = &dln2_pdata_i2c,
>  		.pdata_size = sizeof(struct dln2_platform_data),
>  	},
> +	{
> +		.name = "dln2-spi",
> +		.platform_data = &dln2_pdata_spi,
> +		.pdata_size = sizeof(struct dln2_platform_data),
> +	},
>  };
>  
>  static void dln2_disconnect(struct usb_interface *interface)
Laurentiu Palcu Nov. 11, 2014, 1:09 p.m. UTC | #3
Hi Lee,

On Mon, Nov 10, 2014 at 09:30:05AM +0000, Lee Jones wrote:
> On Fri, 07 Nov 2014, Laurentiu Palcu wrote:
> 
> > Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> > ---
> >  drivers/mfd/dln2.c | 12 ++++++++++++
> >  1 file changed, 12 insertions(+)
> > 
> > diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> > index 9765a17..0cdad2d 100644
> > --- a/drivers/mfd/dln2.c
> > +++ b/drivers/mfd/dln2.c
> > @@ -52,6 +52,7 @@ enum dln2_handle {
> >  	DLN2_HANDLE_CTRL,
> >  	DLN2_HANDLE_GPIO,
> >  	DLN2_HANDLE_I2C,
> > +	DLN2_HANDLE_SPI,
> >  	DLN2_HANDLES
> >  };
> >  
> > @@ -634,6 +635,12 @@ static struct dln2_platform_data dln2_pdata_i2c = {
> >  	.port = 0,
> >  };
> >  
> > +/* Only one SPI port supported */
> > +static struct dln2_platform_data dln2_pdata_spi = {
> 
> Is this ever fiddled with?  If not, const?
Well, if we declare this const we also need to cast the assignment below to
void* since platform_data is void*. Otherwise we get a "assignment
discards ‘const’ qualifier from pointer target type" warning. 

Also, for consistency, we have to do it for all dln2_pdata_*. I'm not
sure it's worth it...

laurentiu

> 
> > +	.handle = DLN2_HANDLE_SPI,
> > +	.port = 0,
> > +};
> > +
> >  static const struct mfd_cell dln2_devs[] = {
> >  	{
> >  		.name = "dln2-gpio",
> > @@ -645,6 +652,11 @@ static const struct mfd_cell dln2_devs[] = {
> >  		.platform_data = &dln2_pdata_i2c,
> >  		.pdata_size = sizeof(struct dln2_platform_data),
> >  	},
> > +	{
> > +		.name = "dln2-spi",
> > +		.platform_data = &dln2_pdata_spi,
> > +		.pdata_size = sizeof(struct dln2_platform_data),
> > +	},
> >  };
> >  
> >  static void dln2_disconnect(struct usb_interface *interface)
> 
> -- 
> Lee Jones
> Linaro STMicroelectronics Landing Team Lead
> Linaro.org ? Open source software for ARM SoCs
> Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Lee Jones Nov. 13, 2014, 10:32 a.m. UTC | #4
On Tue, 11 Nov 2014, Laurentiu Palcu wrote:

> Hi Lee,
> 
> On Mon, Nov 10, 2014 at 09:30:05AM +0000, Lee Jones wrote:
> > On Fri, 07 Nov 2014, Laurentiu Palcu wrote:
> > 
> > > Signed-off-by: Laurentiu Palcu <laurentiu.palcu@intel.com>
> > > ---
> > >  drivers/mfd/dln2.c | 12 ++++++++++++
> > >  1 file changed, 12 insertions(+)
> > > 
> > > diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
> > > index 9765a17..0cdad2d 100644
> > > --- a/drivers/mfd/dln2.c
> > > +++ b/drivers/mfd/dln2.c
> > > @@ -52,6 +52,7 @@ enum dln2_handle {
> > >  	DLN2_HANDLE_CTRL,
> > >  	DLN2_HANDLE_GPIO,
> > >  	DLN2_HANDLE_I2C,
> > > +	DLN2_HANDLE_SPI,
> > >  	DLN2_HANDLES
> > >  };
> > >  
> > > @@ -634,6 +635,12 @@ static struct dln2_platform_data dln2_pdata_i2c = {
> > >  	.port = 0,
> > >  };
> > >  
> > > +/* Only one SPI port supported */
> > > +static struct dln2_platform_data dln2_pdata_spi = {
> > 
> > Is this ever fiddled with?  If not, const?
> Well, if we declare this const we also need to cast the assignment below to
> void* since platform_data is void*. Otherwise we get a "assignment
> discards ‘const’ qualifier from pointer target type" warning. 
> 
> Also, for consistency, we have to do it for all dln2_pdata_*. I'm not
> sure it's worth it...

Yes, perhaps you are right.

Patch applied.

> > > +	.handle = DLN2_HANDLE_SPI,
> > > +	.port = 0,
> > > +};
> > > +
> > >  static const struct mfd_cell dln2_devs[] = {
> > >  	{
> > >  		.name = "dln2-gpio",
> > > @@ -645,6 +652,11 @@ static const struct mfd_cell dln2_devs[] = {
> > >  		.platform_data = &dln2_pdata_i2c,
> > >  		.pdata_size = sizeof(struct dln2_platform_data),
> > >  	},
> > > +	{
> > > +		.name = "dln2-spi",
> > > +		.platform_data = &dln2_pdata_spi,
> > > +		.pdata_size = sizeof(struct dln2_platform_data),
> > > +	},
> > >  };
> > >  
> > >  static void dln2_disconnect(struct usb_interface *interface)
> >
diff mbox

Patch

diff --git a/drivers/mfd/dln2.c b/drivers/mfd/dln2.c
index 9765a17..0cdad2d 100644
--- a/drivers/mfd/dln2.c
+++ b/drivers/mfd/dln2.c
@@ -52,6 +52,7 @@  enum dln2_handle {
 	DLN2_HANDLE_CTRL,
 	DLN2_HANDLE_GPIO,
 	DLN2_HANDLE_I2C,
+	DLN2_HANDLE_SPI,
 	DLN2_HANDLES
 };
 
@@ -634,6 +635,12 @@  static struct dln2_platform_data dln2_pdata_i2c = {
 	.port = 0,
 };
 
+/* Only one SPI port supported */
+static struct dln2_platform_data dln2_pdata_spi = {
+	.handle = DLN2_HANDLE_SPI,
+	.port = 0,
+};
+
 static const struct mfd_cell dln2_devs[] = {
 	{
 		.name = "dln2-gpio",
@@ -645,6 +652,11 @@  static const struct mfd_cell dln2_devs[] = {
 		.platform_data = &dln2_pdata_i2c,
 		.pdata_size = sizeof(struct dln2_platform_data),
 	},
+	{
+		.name = "dln2-spi",
+		.platform_data = &dln2_pdata_spi,
+		.pdata_size = sizeof(struct dln2_platform_data),
+	},
 };
 
 static void dln2_disconnect(struct usb_interface *interface)